From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: command completion
Date: Sun, 14 Aug 2011 21:13:41 -0700 [thread overview]
Message-ID: <110814211341.ZM20215@torch.brasslantern.com> (raw)
In-Reply-To: <20110815005734.GM20653@prunille.vinc17.org>
On Aug 15, 2:57am, Vincent Lefevre wrote:
}
} > [...] because there are two passes and there are no
} > *additional* completions for the "command" tag added inside _cd, all
} > the defaults for _cd get added as well.
}
} OK, but this behavior is a bit strange: if I use
}
} zstyle ':completion:*:complete:-command-:*' tag-order 'commands'
}
} on my example, then I get:
} % prefix-
} prefix-cmd1 prefix-dir/
} from the "dir" directory. And from the parent directory "temp_dir",
} prefix[TAB] gives prefix-cmd1 only (i.e. prefix-dir/ has mysteriously
} disappeared though it is a cd target).
To understand that you have to read comments in _cd, explaining that
it assumes (incorrectly because of your tag-order) that _command_names
has already added all the names of local subdirectories, so _cd should
not do so again.
Wheels within wheels ...
} However wouldn't it be cleaner if there were a specific
} tag for autocd?
Yes, but to do that would require abstracting the guts of both _cd
and _command_names somehow so they could be combined into a single
_tags loop in _autocd. As you're the only person who has complained
about this in many years, there's been no impetus to make that effort.
Most people are probably already have
zstyle ':completion:*:complete:*' group-name ''
and are therefore content with
zstyle ':completion:*:complete:-command-:*' group-order commands
which makes sure that the command names are offered first, rather
than mixed with the directory names.
next prev parent reply other threads:[~2011-08-15 4:14 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
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 [this message]
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=110814211341.ZM20215@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--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).