Subject: pine/vi[m]: passing args to the alternate editor

From: jason carr <[email-masked]>
Date: Thu, 6 Mar 1997 15:42:46 -0600

-----BEGIN PGP SIGNED MESSAGE-----

I have read the vi[m] and pine FAQs and have not seen this 
particular proglem before.

I would like to pass these (or any other) command-line args to 
my alternate editor:

vi -c "set wm=10"
or
vi "+set wm=10"

Note vi[m] needs the ""s around the whitespace-containing
argument.

I can't figure out how to pass this info off to vi[m] 
from pine. I wouldn't mind setting up another .exrc for 
pine's vi[m], but I can't tell vi[m] where to look for the 
new .exrc without passing it /that/ information.  Square one.

It looks as if pine grunges the handoff and vi[m] thinks there
are multiple files to edit.  :(

Is anyone successfully passing commandline info to vi[m]
(or any other editor) from within pine?

Please email as well as follow-up if possible, as my newsfeed
is tragically unreliable (~30% missing posts compared to 
dejanews).

Thanks.  

jason carr   			finger for pubkey
work:	www.cyberline.net	web design and hosting, 
				co-located boxen, free training
play:	www.mousetrap.net	cigars, dfw happyhour, lucidity, VWs

---

From: [email-masked] (Vikas Agnihotri)
Date: 07 Mar 1997 11:13:10 EST

>I would like to pass these (or any other) command-line args to 

Vim has what are called autocommands that are executed for specific
file-patterns *and* specifific events. Look up :help :au. Here is what I have
in my .vimrc

autocmd! BufRead /tmp/pico.* set fo=tcq2 mls=0
autocmd BufRead /tmp/pico.* nmap i :unmap i<CR>:g/^>[ >	]*$/s//<CR>1GOp<CR><Esc>{dp
autocmd BufRead /tmp/pico.* norm i

As you can see, I 'set' certain options for /tmp/pico.* files which is what
Pine launches when replying/composing a mail. Also, I do some manipulation to
the text-buffer before it is read in to make is easier to edit the reply. For
a new-mail, it does nothing since it is operating on a empty buffer.

HTH,
--Vikas

---

From: [email-masked] (Sven Guckes)
Date: 7 Mar 1997 19:00:26 GMT

@vnet.ibm.com (Craig R Kisely):
> > vi -c "set wm=10"
> Try an alias.  alias myeditor='vi -c set wm=10'
> and point pine/etc to myeditor. Think this should work.

What does Pine know of aliases defined by the shell?  Hmm..

> Craig R Kisely  AiC/IBM  [email-masked] [email-masked]

Dollars are allowed in email adresses?  Hmm..

Sven

---

From: Craig R Kisely <"v$craig"@vnet.ibm.com>
Date: Fri, 07 Mar 1997 12:12:41 -0500

> I would like to pass these (or any other) command-line args to

Try an alias.

alias myeditor='vi -c set wm=10'
and point pine/etc... to myeditor

Think this should work.
 
----------------------------------------------------------------
Craig R Kisely       AiC/IBM   
[email-masked]  [email-masked]
http://www.analysts.com/      http://www.ics.raleigh.ibm.com
IBM Internet Division/Software Solutions Group

Disclaimer: All opinions expressed here are my own, and do not
nescessarily reflect those of IBM or AiC.
----------------------------------------------------------------

---

From: jason carr <[email-masked]>
Date: Fri, 7 Mar 1997 11:26:22 -0600

-----BEGIN PGP SIGNED MESSAGE-----

> and point pine/etc... to myeditor

Good idea.

I made the alias, then tested the alias from the command 
line.  Started pine and made the change to myeditor, saved,
and re-started pine.

Pine chokes and says "Alternate editor abnormally terminated (255)".
I searched for this errormessage in the newsgroups and found
no other references for it.

Anyone know of a workaround?

---

From: [email-masked] (Orjan Johansen)
Date: 8 Mar 1997 01:43:30 GMT

In article <[email-masked]>,
>Try an alias.

They tend not to get run from anything except a shell command line, so 
I use shell scripts instead.

>and point pine/etc... to myeditor

Or make ~/bin/myeditor the shell script
----
#!/bin/sh
exec vi -c set wm=10 $*
----
Remember to chmod +x ~/bin/myeditor
Also, $HOME/bin needs to be in your $PATH.

Greetings,
Ørjan.

---

From: [email-masked] (Orjan Johansen)
Date: 8 Mar 1997 01:43:30 GMT

Greetings,
Ørjan.

---

From: [email-masked] (Vikas Agnihotri)
Date: 10 Mar 1997 07:27:18 EST

For details on Vim, http://www.math.fu-berlin.de/~guckes/vim
You wont be sorry. Vim is a truly superb editor with full-Vi-compatibility!

HTH,
--Vikas

---

From: Alan Shutko <[email-masked]>
Date: 11 Mar 1997 09:53:27 -0600

>>>>> "Craig" == Craig R Kisely <"v$craig"@vnet.ibm.com> writes:

>> What does Pine know of aliases defined by the shell?  Hmm..

Craig> Well... if I launch pine in the shell, wouldn't it stand to
Craig> reason that it receives the environment from the shell?

It receives the environment, but only as much as environment
variables.  Aliases are often not carried through when executing a
second shell: pine neither gets them nor would know what to do with
them if it did.

Depending on whether pine uses exec or system, it could even require
that the editor be a script or executable.

>> Dollars are allowed in email adresses?  Hmm..

Craig> I sure hope so... Or it would be hard to explain why I recieve
Craig> my email, wouldn't it?  Pull your cork out of your ass.

For all he knew, maybe you didn't _want_ to receive your email.  After
all, the number of people who munge all email addresses in their
postings grows every day.

-- 
Alan Shutko <[email-masked]> - By consent of the corrupted
If dolphins are so smart, why did Flipper work for television?