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

Re: Avoid LDAP hit during completion



Peter,

My apology for the late reply.  I was out of town for a few days.

I tried your suggested solution and now it doesn't seem to hit LDAP any more.

Thank you so much.

Chris

On Jun 8, 2005, at 2:35 AM, Peter Stephenson wrote:

Chris wong wrote:

Peter, thanks for the xtrace trick.  Here is the partial output. The
completion slow down (or appeared to be frozen) at _all_labels:39,
(boxed up in asterisks below).  Any help would be much appreciated.


OK, so it was userdirs... You can relatively easily stop this happening for most contexts by copying the _users function to somewhere earlier in
your $fpath and commenting out the last line.  You can still have
a list of specific users you want to complete, but it won't query the
system. (If you have permission you can doctor _users in place, of course.)

There are still other places that use userdirs.  One is the _expand
completer.  If you use that you can do a similar trick by commenting
out the complete expression in braces:

{ [[ ( "$word" = \~* && ${#userdirs[(I)${word[2,-1]}*]}+$ {#nameddirs[(I)${word
[2,-1]}*]} -gt 1 ) ||
       ( "$word" = *\$[a-zA-Z0-9_]## &&
         ${#parameters[(I)${word##*\$}*]} -ne 1 ) ]] && continue=1 }

You can decide if you need to worry about _tilde_files.

I can see uses for a feature to override special parameters like
userdirs selectively. Unfortunately the current state of the parameter
code makes implementing this very hairy.

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



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************





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