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

Re: zfinit problem in ksh emulation mode



On Wed, 28 Jul 2010 15:43:20 +0200
Jerry Rocteur <jerry.rocteur@xxxxxxxxx> wrote:
> Thanks Peter, I can't change all the installation, I did try the -Uz
> zfinit but then it failed with zfparams: function not defined.

You can copy zfinit somewhere earlier in your FPATH, which you might
need to set explicitly in your script (fpath doesn't work in ksh mode).

> > The obvious one to try is "unsetopt kshautoload".
> >
> > I tried it but then when running zfinit I get:
> 
> zfinit:42: command not found: compctl
> zfinit:50: command not found: compctl
> zfinit:51: command not found: compctl
> zfinit:52: command not found: compctl
> zfinit:53: command not found: compctl
> zfinit:58: command not found: compctl
> zfinit:67: command not found: compctl

You don't need compctl.  I think the problem is simply that it's not
autoloaded (as a builtin from a library) in ksh mode.  This a rather
different issue and compctl is thouroughly out of date anyway; I probably
need to check if compctl is present.  This should be harmless, in fact.

Index: Functions/Zftp/zfinit
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Zftp/zfinit,v
retrieving revision 1.3
diff -p -u -r1.3 zfinit
--- Functions/Zftp/zfinit	28 Jul 2010 13:33:59 -0000	1.3
+++ Functions/Zftp/zfinit	28 Jul 2010 15:18:28 -0000
@@ -34,7 +34,8 @@ autoload -Uz zfstat zftp_chpwd zftp_prog
 # zftp completions: only use these if new-style completion is not
 # active.
 #
-if [[ ${#_patcomps} -eq 0 || -z ${_patcomps[(r)_zf*]} ]]; then
+if [[ ${#_patcomps} -eq 0 || -z ${_patcomps[(r)_zf*]} ]] &&
+  (compctl >/dev/null 2>&1); then
   # only way of getting that noglob out of the way: this is unnecessary with
   # widget-based completion
   setopt completealiases

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



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