zsh-users
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Alexandre Duret-Lutz <duret_g@lrde.epita.fr>, zsh-users@sunsite.auc.dk
Subject: Re: more wishes with automounter
Date: Tue, 12 Sep 2000 06:58:47 +0000	[thread overview]
Message-ID: <1000912065847.ZM5756@candle.brasslantern.com> (raw)
In-Reply-To: <mvb66o27s0g.fsf@phobos.lrde.epita.fr>

On Sep 11,  7:33pm, Alexandre Duret-Lutz wrote:
} Subject: more wishes with automounter
}
}    /nfs/hosts1 -> /var/autofs/nfs/host1
}    /nfs/hosts2 -> /var/autofs/nfs/host2
}    /nfs/hosts3 -> /var/autofs/nfs/host3
} etc...
} 
} The problem is that using Zsh to complete /nfs/hos<TAB> will
} mount *all* the directories, because the completion code stat()
} all links (and stat()ing a link will lead to the mount of the
} linked directory).  I believe that Zsh may use lstat() instead,
} but since I don't know where that guilty stat() is I haven't
} tried.

I think the stat must be an effect of the way _path_files does globbing
to try to segregate files by type.  I don't see any stat() calls in
strace output if I don't have any styles set (and this time I did check
that the new completion system really was loaded (blush)).

Try this:

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

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

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

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

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


  reply	other threads:[~2000-09-12  6:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-11 14:36 3.1.9 completion problems: automounter E. Jay Berkenbilt
2000-09-11 17:33 ` more wishes with automounter Alexandre Duret-Lutz
2000-09-12  6:58   ` Bart Schaefer [this message]
2000-09-13  9:32     ` Alexandre Duret-Lutz
2000-09-13 15:02       ` Bart Schaefer
2000-09-12  5:20 ` 3.1.9 completion problems: automounter Bart Schaefer
2000-09-12  6:14   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1000912065847.ZM5756@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=duret_g@lrde.epita.fr \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).