* PATCH: _expand limitation
@ 2000-03-17 17:32 Oliver Kiddle
2000-03-23 8:29 ` Let's obey our own development guide :-) Andrej Borsenkow
0 siblings, 1 reply; 2+ messages in thread
From: Oliver Kiddle @ 2000-03-17 17:32 UTC (permalink / raw)
To: Zsh workers
I just did vi *(w)<tab> and expected it to expand to the one writable
file in the directory. It didn't work though. The trouble is that
_expand tries to expand things by doing ${~exp}(N). This means that it
is in effect trying to expand *(w)(N) which isn't the same as *(wN). The
easiest solution I can think of is if _expand does setopt localoptions
nullglob though someone else may have a better idea. The patch adds
this.
Oliver
--- _expand.bak Fri Mar 17 17:16:01 2000
+++ _expand Fri Mar 17 17:17:48 2000
@@ -7,6 +7,8 @@
# the expansions done produce no result or do not change the original
# word from the line.
+setopt localoptions nullglob
+
[[ _matcher_num -gt 1 ]] && return 1
local exp word="$PREFIX$SUFFIX" sort expr expl subd suf=" "
@@ -42,7 +44,7 @@
zstyle -s ":completion:${curcontext}:" glob expr &&
[[ "${(e):-\$[$expr]}" -eq 1 ]] &&
- exp=( ${~exp}(N) )
+ exp=( ${~exp} )
# If we don't have any expansions or only one and that is the same
# as the original string, we let other completers run.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Let's obey our own development guide :-)
2000-03-17 17:32 PATCH: _expand limitation Oliver Kiddle
@ 2000-03-23 8:29 ` Andrej Borsenkow
0 siblings, 0 replies; 2+ messages in thread
From: Andrej Borsenkow @ 2000-03-23 8:29 UTC (permalink / raw)
To: Oliver Kiddle, Zsh workers
>
> --- _expand.bak Fri Mar 17 17:16:01 2000
> +++ _expand Fri Mar 17 17:17:48 2000
Etc/zsh-development-guide:
* Send only context diffs "diff -c oldfile newfile" or unified diffs
"diff -u oldfile newfile". They are much easier to read and
understand while also allowing the patch program to patch more
intelligently. Please make sure the filenames in the diff header
are relative to the top-level directory of the zsh distribution; for
example, it should say "Src/init.c" rather than "init.c" or
"zsh/Src/init.c".
-andrej
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-03-23 8:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-17 17:32 PATCH: _expand limitation Oliver Kiddle
2000-03-23 8:29 ` Let's obey our own development guide :-) Andrej Borsenkow
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).