Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: completion lists revisted
- X-seq: zsh-workers 3636
- From: Peter Stephenson <pws@xxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx, zsh@xxxxxxxx
- Subject: PATCH: completion lists revisted
- Date: Thu, 27 Nov 1997 11:10:53 +0100
- In-reply-to: ""Bart Schaefer""'s message of "Fri, 21 Nov 1997 10:39:53 MET." <971121103953.ZM14674@xxxxxxxxxxxxxxxxxxxxxxx>
"Bart Schaefer" wrote:
> Anyway, I guess I'd go with -Y and one of -y or -W for what we're talking
> about now. Doesn't really matter which means which. Or you could do all
> three; use -y and -Y like -k and -K, except for modifying the listing,
> and use -W as an expanding -X.
Here's the complete thing, incorporating the earlier patches: -y
replaces the list for display with something returned from a function
or variable, -Y does expansion on the explanation string. (-W was
already taken up with the patch for `with-directory', i.e. `-W ~/Mail
-f' completes files and paths under ~/Mail; you need that patch for a
clean application of this one, although they are functionally
independent.)
-y is handled first, so you can change variables for -Y: a useless
example is:
fn() {
reply=();
local line
if (( $# )); then
expl="Select a file from the list"
ls -fld $*| while read line; do reply=($reply $line); done
(( $# == 1 )) && expl="Unique completion\!"
fi
}
compctl -f -y fn -Y '$expl' foo
(The only real point of using both at once is that the formatting is
done differently for the explanation and the completion list.)
I changed one additional piece of logic: the mere presence of an
explanation string used to force alternative completions not to be
tried. For example,
compctl -k '(foo bar)' -X 'Yeah.' + -k '(Foo Bar)' foo
would never look at the Foo Bar possibilities (`foo F^D' would just
mindlessly say `Yeah.'). Maybe someone can explain this.
begin 644 compctl_yY_patch.gz
M'XL("+1!?30``UEO65]A;&PN='AT`.T[^W?3R-4_NW_%).T2*9:#'TD<QV7W
MI)!V.1L@)6R!4@Z5Y9&M1I:,'G%,X7_O?<R,1H[":[=\WY[3+!MLS9T[]_W2
ML+N[*QZDP=V_Y_.[0;I8!D6\MT[W7J8O6\_FI;B02]$[$MW1\<'1\6`D>J/1
M\'>=3J=A#\$_3J]$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