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

Re: compctl for pine



On Jul 13,  5:07pm, Timothy J. Luoma wrote:
} Subject: compctl for pine
}
} I am trying to setup 'compctl' for use with pine, and another for  
} telnet/ftp.  However, I really don't know how compctl works, and  
} have never tried to tackle one on my own before.
} 
} Would anyone be willing to help me put this together, or refer me  
} to some reading materials (especially examples) OTHER than the man  
} page, which I read already...

Look in Misc/compctl-examples in the zsh 3.0-pre2 distribution.  Of
particular interest is the compctl for "mail" and "elm":

compctl -u -x 's[+] c[-1,-f],s[-f+]' -g '~/Mail/*(:t)' - \
        's[-f],c[-1,-f]' -f -- mail elm

The -u completes user names (e.g. local email addresses) as the default
behavior.  The -x ... - part turns the `+' character immediately after
`mail -f' into an abbreviation for ~/Mail/, so you can complete folder
names.  The 's[-f] ...' -f part causes files in the current directory
to be completed after -f when no `+' abbreviation is present.

If you want to complete email addresses other than local user names, you
have two choices:
1.  Use `compctl -K somefunction' where `somefunction' outputs the list
    of addresses you want; or
2.  Stuff the addresses into a zsh array variable (e.g. `Eaddresses') and
    use `compctl -k Eaddresses'.

BTW, zsh-workers, either something about backslashes in single quotes
changed, or something about quoting of completed strings changed, in
3.0.  My CVS entry in Misc/compctl-examples needs the following fix.
Have the other examples been checked for such changes in zsh behavior?

*** Misc/compctl-examples.0	Fri Jul  5 10:57:42 1996
--- Misc/compctl-examples	Sat Jul 13 16:03:41 1996
***************
*** 401,407 ****
  # log assumes gnu rcs
  
  compctl -k "($cvscmds $cvsflags)" \
!     -x "c[-1,-D]" -k '(today yesterday 1\\\ week\\\ ago)' \
      - "r[add,;]" -k "(-k -m)" -f \
      - "r[admin,;]" -K cvstargets \
      - "r[checkout,;]" -k "(-A -N -P -Q -c -f -l -n -p -q -s -r -D -d -k -j)" \
--- 401,407 ----
  # log assumes gnu rcs
  
  compctl -k "($cvscmds $cvsflags)" \
!     -x "c[-1,-D]" -k '(today yesterday 1\ week\ ago)' \
      - "r[add,;]" -k "(-k -m)" -f \
      - "r[admin,;]" -K cvstargets \
      - "r[checkout,;]" -k "(-A -N -P -Q -c -f -l -n -p -q -s -r -D -d -k -j)" \

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern

New male in /home/schaefer:
>N  2 Justin William Schaefer  Sat May 11 03:43  53/4040  "Happy Birthday"




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