zsh-users
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: zsh-users@zsh.org
Subject: Re: command completion
Date: Sun, 14 Aug 2011 23:54:44 +0200	[thread overview]
Message-ID: <20110814215444.GJ20653@prunille.vinc17.org> (raw)
In-Reply-To: <CAHYJk3Q7Rz+RWrYiAMhHaT39BORSE+a6CErWNMROsCMbiZMfeA@mail.gmail.com>

On 2011-08-14 23:09:37 +0200, Mikael Magnusson wrote:
> On 14 August 2011 22:59, Vincent Lefevre <vincent@vinc17.net> wrote:
[...]
> > Now, if I move blah-cmd somewhere else in $PATH, and use
> >
> > % zstyle ':completion:*:complete:-command-:*' tag-order 'commands'
> > % blah[TAB]
> >
> > then only blah-cmd is proposed, as expected. However if I do:
> >
> > % mkdir ~/blah-hdir
> > % cdpath=(. ~)
> > % setopt AUTO_CD
> > % blah[TAB]
> >
> > then both blah-cmd and blah-hdir/ are proposed. I don't see why
> > blah-hdir/ should be regarded as a command.
> 
> Because it might contain executable files?

Then what?

First, zsh does not complete to such executable files, so that's
a wrong reason. Moreover such executable files cannot be executed
anyway, because they are not in the path!

And if the current directory happens to be $HOME, zsh does not
propose blah-hdir/ in the completions.

It seems the reason is that the directory (and possible subdirectories)
is a candidate for the autocd. But my point is that such a directory is
not a command ('commands' was specified first in tag-order).

> What happens when you only create the dir and don't do the other
> things?

Both the "cdpath=(. ~)" and "setopt AUTO_CD" are necessary to make
this (IMHO incorrect) behavior appear. Otherwise blah-hdir/ is not
proposed as a completion.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


  reply	other threads:[~2011-08-14 21:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-14 20:59 Vincent Lefevre
2011-08-14 21:09 ` Mikael Magnusson
2011-08-14 21:54   ` Vincent Lefevre [this message]
2011-08-14 22:14 ` Bart Schaefer
2011-08-14 23:07   ` Vincent Lefevre
2011-08-14 23:56     ` Bart Schaefer
2011-08-15  0:57       ` Vincent Lefevre
2011-08-15  4:13         ` Bart Schaefer
2011-08-15  9:18           ` Vincent Lefevre
2012-09-11 12:55 Command Completion Nick Cross
2012-09-11 14:15 ` 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=20110814215444.GJ20653@prunille.vinc17.org \
    --to=vincent@vinc17.net \
    --cc=zsh-users@zsh.org \
    /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).