Subject: line numbering with Pine

From: Roman Czyborra <[email-masked]>
Date: Sun, 28 Sep 1997 09:29:07 +0200 (CEST)

If you have to be careful to put text on the right number lines or to
stay below a certain line - for instance because you are using Stack's
e-mail to snail mail gateway http://stack.com/e-snail.html - you don't
have to count your lines manually with greasy fingers on your screen
and errors likely but you can use

	less -N

as your alternate editor command to check the numbering.

For those who have never used the alternate-editor command before:  In
order to be able to enter other editor commands you have to check

            [X]  enable-alternate-editor-cmd
            [ ]  enable-alternate-editor-implicitly

and editor = <No Value Set> in your Pine configuration menu and then
you press ^_ (Control+Underscore) while you're composing message text. 
To see line numbers, type ^K (Control+K) and "less -N" then.

I don't know whether this answers a frequently asked question or is
just an unsolicited Unix trick.

---

From: Roman Czyborra <[email-masked]>
Date: Sun, 28 Sep 1997 13:58:38 +0200 (CEST)

#!/usr/local/bin/perl -w

# $Id: xurl,v 1.11 1997/09/26 22:22:22 czyborra Exp $
# (C) 1997 Roman [email-masked]
# This URL extractor converts a text/plain into a text/html lookalike
# with anything looking like a URL turned into a hyperlink and then
# hands it over to lynx so the user can easily follow references.
# I use xurl as one of my (bogus) print-commands in Pine.

$tempfile="/tmp/xurl$$.html";
$protocol="(http|file|ftp|gopher|wais|news|nntp|finger|telnet)";
$urlender="][\"`'><\\s"; $punct=").,:;\?";

open (STDOUT, ">$tempfile") || die "Cannot write $tempfile: $!\n";

while (<>)
{
    s~&~&amp;~g; s~<~&lt;~g; s~\n~<BR>\n~; s~\swww[.]\b~ http://www.~gi;
    s~($protocol:[^$urlender]+[^$urlender$punct])~<A HREF="$1">$1<\/A>~gi;
    print;
}

close STDOUT;

exec "sh", "-c", "exec </dev/tty >/dev/tty 2>/dev/tty
      lynx -child $tempfile; rm -f $tempfile";

---

From: "Robin S. Socha" <[email-masked]>
Date: 28 Sep 1997 14:12:57 +0200

>> "RC" == Roman Czyborra <[email-masked]> writes:

RC> If you have to be careful to put text on the right number lines or
RC> to stay below a certain line [...] you can use
RC> less -N
RC> as your alternate editor command to check the numbering.

Hmm? Less is more, but certainly not an editor.

RC> I don't know whether this answers a frequently asked question or
RC> is just an unsolicited Unix trick.

Let's see... less is:

       [...]  a program similar to more (1), but which allows backward
       movement in the file as well as forward movement.  [...]

and can do:

       v Invokes an editor to edit the current file being viewed.
       The editor is taken from the environment variable VISUAL if
       defined, or EDITOR if VISUAL is not defined, or defaults to
       "vi" if neither VISUAL nor EDITOR is defined.

I don't get this... If I were crazy enough to use vi (hi, Sven...),
I'd set my alternate editor to vi (and start XEmacs in viper mode...),
because vi can do line-numbering. So can joe, btw, an editor which I
will advocate here for as long as pico exists. joe -linum

But... the less -N option is neat. Thanks ;-)

Have a nice Sunday,
Robin

-- 
Robin S. Socha, M.A.
Political Science Dept., Bonn University 
On the package it said: "Requires MS Windows 3.11 or better"  
      			      ...  so I got myself Linux.