Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: "fake" style requires at least one real match?
- X-seq: zsh-workers 39835
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: "fake" style requires at least one real match?
- Date: Fri, 4 Nov 2016 20:48:01 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=RPEx6gA6oppr5yln1VE86oSPz5w00eMc3QuaOozJfDk=; b=XZ0kfjsT6O/jccL1b4KSGFnVtKfzeLvsx+JW6Ql1wMdEcfTwyx63yKKmSZIbTEtPml LhIDqPQpTIkwkZmLuDG2wLo5FgFdN5AlEkPjF++Xut3Q78D2CPh0KFDHj6ZvtMx5ZuzJ GZLzXZshHB9MAMDe7wQZ9jw9kGXo5zr5ZKFHQGM/duBHTZuN+YGIzB+TTQqM07sQrU5T rOJxETsL6yb1MgwyIxFNnZZhtxuLKSht6572PdoUnUG/hWpz6djnlv9VK8OWojH7rYd3 IGd5OXhrY8j4RTwIrVoyuojbG9DFPGb/0Sm3QHOqL3v5RQI/56oJKxXIVvz4vsjc6SMF aWjg==
- In-reply-to: <24199.1478268003@hydra.kiddle.eu>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <161103173955.ZM13768@torch.brasslantern.com> <24199.1478268003@hydra.kiddle.eu>
On Nov 4, 3:00pm, Oliver Kiddle wrote:
} Subject: Re: "fake" style requires at least one real match?
}
} Bart wrote:
} > This is essentially the same Q-and-A as from users/10988 almost exactly
} > ten years ago. The difference is that the solution in that message no
} > longer works.
} >
} > zstyle -e ':completion::complete:cd:*:named-directories-mine' \
} > ignored-patterns 'reply=("(${(qkj.|.)nameddirs})")'
}
} In my testing, the (q) flag in there is preventing ignored-patterns
} from working because the | separators get quoted.
That may be true, but I can reproduce with a different pattern that is
neither eval'd nor (q)'d.
With this:
setopt cdablevars
mydirs=( mydir1 mydir2 )
zstyle -e ':completion::complete:cd:*:named-directories-mine' \
fake 'reply=($mydirs)'
zstyle ':completion::complete:cd:*:named-directories-mine' \
ignored-patterns '?[^y]*'
zstyle ':completion::complete:cd:*' tag-order \
'named-directories:-mine:extra\ directories'
That should ignore anything that doesn't have a "y" as the second
character, and show only the corresponding subset of nameddirs.
% hash -d move=$PWD
% hash -d home=$HOME
% cd m<TAB>
move mydir1 mydir2
Why wasn't "move" ignored here? (I had to have at least one character
of prefix to get it to offer named-directories at all.)
After adding a few more styles to format the listing:
torch% cd m
Completing extra directories
move mydir1 mydir2
So it's using the named-directories-mine context, but it's including
a word that it shouldn't.
This doesn't always happen. If I switch to local-directories in the
above, it works as expected. So maybe there's some interaction with
using the -a or -k options to compadd.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author