Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Completion for pine is broken

 --- Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> This dates from long, long ago, possibly from the introduction of
> _pine.
> (As you can guess, I hardly ever start pine from the shell; it's
> always
> running in its own xterm and I just open new folders from the pine
> menus).

I wouldn't have guessed you'd be running pine at all instead of Z-mail.

> There's this snippet in _pine:
> if [[ -n $+_cache_pine_options ]]; then
>   for optfile in ~/.pinerc /etc/pine.conf; do
>     if [[ -f $optfile ]]; then
>       getopts="cat $optfile"
>       break
>     fi
>   done
>   _cache_pine_options=( $($=getopts | sed -n 's/^\([^#]*=\).*/-\1/p')
> )
> fi
> And then there's my .pinerc, which has this fragment:
> folder-collections=Mail mail/[],
>         "Archives on zanshin.com" {zanshin.com}/archive/[%],
>         Home [],
>         "Home on zanshin.com" {zanshin.com/debug}/home/schaefer/[]
> The double quotes in those folder-collection names wreak havok.  In
> general,
> any word in a .pinerc can be a quoted string.  I really don't follow
> what
> that code in _pine is supposed to be doing, but whatever it is is
> broken.

Every configuration item in pine can be used on the command line like a
normal option. That code was there to try to pick up a .pinerc file to
get a list of all the configuration options. What I can't remember is
why I got it to try .pinerc files before running pine -conf. It might
have been because it was faster or it might have been because running
pine -conf omits some options. Whatever it was, I doubt it was
particularly critical. I don't use pine so only ever tested it with a
default pine configuration. Can you try the attached (to avoid
word-wrap) patch and let me know if it works. It just uses pine -conf
which I hope doesn't risk problems with quoted values messing up the
sed expression.

As an aside, _pine could perhaps use two calls to _arguments so that
you can select between the two sets of options with a tag-order.


Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
--- Completion/Unix/Command/_pine	Thu Jan 17 10:24:39 2002
+++ Completion/Unix/Command/_pine	Thu Feb 21 12:26:30 2002
@@ -1,16 +1,10 @@
 #compdef pine pinef
 local curcontext="$curcontext" state line expl suf
-local optfile getopts='pine -conf' sortorder lusortorder opts send idx
+local sortorder lusortorder opts send idx
 if [[ -n $+_cache_pine_options ]]; then
-  for optfile in ~/.pinerc /etc/pine.conf; do
-    if [[ -f $optfile ]]; then
-      getopts="cat $optfile"
-      break
-    fi
-  done
-  _cache_pine_options=( $($=getopts | sed -n 's/^\([^#]*=\).*/-\1/p') )
+  _cache_pine_options=( $(_call_program pine-options pine -conf| sed -n 's/^\([^#]*=\).*/-\1/p') )
 sortorder=( {subject,arrival,date,from,size}{,/reverse} )

Messages sorted by: Reverse Date, Date, Thread, Author