Zsh Mailing List Archive
Messages sorted by:
Re: PATCH: Add CORRECT_NOCOMPSYS option
- X-seq: zsh-workers 27009
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: Add CORRECT_NOCOMPSYS option
- Date: Thu, 28 May 2009 11:25:14 +0200
- In-reply-to: <2d460de70905280148iebfcegcb4143c33e510efd@xxxxxxxxxxxxxx>
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <1238890030-4683-1-git-send-email-ft@xxxxxxxxxxxxxxxxxxx> <090404193718.ZM19801@xxxxxxxxxxxxxxxxxxxxxx> <20090405191304.1908fca8@pws-pc> <090405151115.ZM13159@xxxxxxxxxxxxxxxxxxxxxx> <20090406100929.505617e2@news01> <2d460de70905270930j681da6a5kf7848d67d89f0c69@xxxxxxxxxxxxxx> <20090527175941.3bbe2eba@news01> <m37i02cqd9.fsf@xxxxxxxxxxxxxx> <2d460de70905280148iebfcegcb4143c33e510efd@xxxxxxxxxxxxxx>
Richard Hartmann <richih.mailinglist@xxxxxxxxx>:
> On Wed, May 27, 2009 at 21:12, Greg Klanderman <gak@xxxxxxxxxxxxxx> wrote:
> > But in the same vein, what I really want is a way to configure the
> > behavior for functions, variables, etc. beginning with "_" to be like
> > filenames beginning with ".": completion should work if I have
> > explicitly typed the leading "_", but even substring matching should
> > not *generate* a leading "_".
> I think this is a good explanation of what, imo, the final goal should
The final goal for what?
For completion (without looking at it in detail), I think what Greg
wants could be done with the _ignore completer. At least I got
something similar for a set of commands:
zstyle ':completion:*:complete:-command-::commands' \
Because I never want to complete the commands named
aptitude-create-state-bundle or aptitude-run-state-bundle.
With the above style 'apti<tab>' always completes to 'aptitude'.
But 'aptitude-<tab>' offers the two commands mentioned earlier, too,
in case I really really want one of them.
My completer style looks like this:
zstyle ':completion:*' completer _expand _complete _ignored _approximate
Where _ignore is the important bit.
That's completion. Correction is a whole other deal. And
CORRECT_IGNORE is just for that. So you don't get completion functions
as _suggestions_ for _correction_. (E.g. you don't have vim installed
but you try to execute it, chances are that correction will ask you
'zsh: correct 'vim' to '_vim'? (YNEA)' - which is utterly useless and
So, when you're talking about a final goal, IMHO, CORRECT_IGNORE is
quite a reasonable solution. And it *only* works on words in command
position (aka. the stuff 'setopt correct' does - words corrected by
'setopt correct_all' are not touched at all).
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
Messages sorted by: