zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Re: A couple completion glitches
@ 2000-06-29  7:09 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2000-06-29  7:09 UTC (permalink / raw)
  To: zsh-workers


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@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

* PATCH: Re: A couple completion glitches
@ 2000-06-26  9:34 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2000-06-26  9:34 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Jun 24, 12:54pm, Wayne Davison wrote:
> } Subject: A couple completion glitches
> }
> } I've noticed that the new completion system won't ever complete a name
> } that matches the $fignore list, even if it is the only completion
> } possible.
> 
> Yes, that's correct.  To get the new completion system to act like the
> old one, you need something like
> 
>     zstyle ':completion:*:all-files' ignored-patterns \*$^fignore

No, the _ignored completer, which is used by default, but there was a
bug in it: it didn't find the right completers to use because it used
a parameter it had just declared local.

But of course one *can* replace $fignore with the above. Welcome to
the world of hey-look-at-all-the-things-we-can-ignore-now ;-)


In another message:

> You DO need to set the suffix style, but you need to set it to "false".
> 
> Which, now that I think about it, sounds backwards to me.  It means "do
> not make a special case of expansions that have a suffix" but it *seems*
> to mean "do not expand the suffix."  Which is how I got confused about
> what _expand was testing with "zstyle -T" in the first place ...

Hmhm, I found that rather confusing, too. But I was terribly confused
by all the possible interactions between the styles and such when
writing all that anyway. I was tempted to call it `no-suffix' but that 
wouldn't be very obvious either. Does anyone have a good suggestion,
probably avoiding `suffix' completely?


Bye
 Sven

Index: Completion/Core/_ignored
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_ignored,v
retrieving revision 1.3
diff -u -r1.3 _ignored
--- Completion/Core/_ignored	2000/05/08 08:16:32	1.3
+++ Completion/Core/_ignored	2000/06/26 09:32:56
@@ -4,11 +4,13 @@
 
 [[ _matcher_num -gt 1 || $compstate[ignored] -eq 0 ]] && return 1
 
-local comp _comp_no_ignore=yes tmp expl \
-      _completer _completer_num _matcher _matchers _matcher_num
+local comp
 
 zstyle -a ":completion:${curcontext}:" completer comp ||
   comp=( "${(@)_completers[1,_completer_num-1][(R)_ignored(|:*),-1]}" )
+
+local _comp_no_ignore=yes tmp expl \
+      _completer _completer_num _matcher _matchers _matcher_num
 
 _completer_num=1
 

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-06-29  7:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-29  7:09 PATCH: Re: A couple completion glitches Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2000-06-26  9:34 Sven Wischnowsky

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).