Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: A couple completion glitches
- X-seq: zsh-workers 12115
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: Re: A couple completion glitches
- Date: Thu, 29 Jun 2000 09:09:06 +0200 (MET DST)
- In-reply-to: Wayne Davison's message of Sun, 25 Jun 2000 01:38:07 -0700 (PDT)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Wayne Davison wrote:
> ...
>
> It still seems strange to me that (without the above suffix option)
> foo* gets glob expansion but ~/foo* does not. Surely this should not
> be the default even if this turns out (for some strange reason) not to
> be a bug.
This really wasn't intended; I didnt' think of the interaction with
pattern characters in the suffix.
How about this patch: it changes the meaning of the suffix style to
`don't expand if there is a suffix, unless that contains something
exapandable'.
I still think there is a better name for this, but I still can't think
of one.
Bye
Sven
Index: Completion/Core/_expand
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_expand,v
retrieving revision 1.21
diff -u -r1.21 _expand
--- Completion/Core/_expand 2000/06/29 06:59:00 1.21
+++ Completion/Core/_expand 2000/06/29 07:08:49
@@ -36,7 +36,7 @@
[[ "$word" = *\$\{[^\}]# ]] && return 1
zstyle -T ":completion:${curcontext}:" suffix &&
- [[ "$word" = (\~*/*|\$[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]*|\$\{*\}?*) ]] &&
+ [[ "$word" = (\~*/|\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|\$\{*\}?)[^\$\{\}\(\)\<\>?^*#~]# ]] &&
return 1
zstyle -t ":completion:${curcontext}:" accept-exact ||
Index: Doc/Zsh/compsys.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compsys.yo,v
retrieving revision 1.78
diff -u -r1.78 compsys.yo
--- Doc/Zsh/compsys.yo 2000/06/29 07:04:17 1.78
+++ Doc/Zsh/compsys.yo 2000/06/29 07:08:50
@@ -1888,7 +1888,8 @@
tilde or parameter expansion. If it is set to `true', the word will
only be expanded if it doesn't have a suffix, i.e. if it is something
like `tt(~foo)' or `tt($foo)', but not if it is `tt(~foo/)' or
-`tt($foo/bar)'. The default for this style is `true'.
+`tt($foo/bar)', unless that suffix itself contains characters eligible
+for expansion. The default for this style is `true'.
)
kindex(tag-order, completion style)
item(tt(tag-order))(
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author