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

Re: more wishes with automounter



>>> "Bart" == Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> writes:

[...]

 Bart> Try this:

 Bart>     ztyle -e ':completion:*' file-patterns \
 Bart>       '[[ $PREFIX == /nfs/[^/]# ]] && \
 Bart>         { setopt noglob ; reply=(*(@)) ; setopt glob }'

 Bart> (Twaddling noglob like that was the only way I could get
 Bart> zstyle -e to put a file pattern into $reply -- the
 Bart> eval-ing messed up any other quoting I could think of.)
 Bart> This just says that if you're completing within the /nfs/
 Bart> directory itself, don't consider anything other than
 Bart> symlinks.  As I'm not sure why/where those links are
 Bart> getting stat()d, this may not be of any help ... but then
 Bart> again, it may.

This worked (i.e. directories are not automounted as a side effect
of completion).  But I couldn't get it to complete symlinks and
directories (my /nfs/ directory contains both).  Using:

    zstyle -e ':completion:*' file-patterns \
      '[[ $PREFIX == /nfs/[^/]# ]] && \
        { setopt noglob ; reply=(*(@,/)) ; setopt glob }'

Leads to:

~ % ls /nfs/<TAB>
_path_files:327: bad pattern: /nfs/*(@

 Bart> } [*] another wish would be that Zsh complete those invisible
 Bart> }     directories; or more generaly: give the user the possiblity
 Bart> }     to add "virtual files" (anywhere he want), that Zsh would
 Bart> }     use for completion.

 Bart> The article that PWS referenced about this is zsh-users/3408.

Thanks, I had to get it from the archives
(Murphy's law: my zsh-users mbox bumps from 3406 to 3408...)
-- 
Alexandre Duret-Lutz



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