zsh-workers
 help / color / mirror / code / Atom feed
* Use of named directories in completions broken.
@ 2001-04-30 10:37 Peter Stephenson
  2001-04-30 11:08 ` PATCH: " Sven Wischnowsky
  2001-04-30 15:47 ` Peter Stephenson
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Stephenson @ 2001-04-30 10:37 UTC (permalink / raw)
  To: Zsh hackers list

Some recent change has broken named directories in completions.  It now
insists on trying to expand it instead.  I use _expand in my list of
completers to do expansion; removing this seems to fix it, and using
expand-or-complete instead works OK.

I don't have any of the prefix or suffix styles to anything non-standard.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


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

* PATCH: Re: Use of named directories in completions broken.
  2001-04-30 10:37 Use of named directories in completions broken Peter Stephenson
@ 2001-04-30 11:08 ` Sven Wischnowsky
  2001-04-30 11:19   ` Peter Stephenson
  2001-04-30 15:47 ` Peter Stephenson
  1 sibling, 1 reply; 6+ messages in thread
From: Sven Wischnowsky @ 2001-04-30 11:08 UTC (permalink / raw)
  To: zsh-workers

Peter Stephenson wrote:

> Some recent change has broken named directories in completions.  It now
> insists on trying to expand it instead.  I use _expand in my list of
> completers to do expansion; removing this seems to fix it, and using
> expand-or-complete instead works OK.

You mean that it expands the named dir, right?

Yes, ahem, I said in a comment above the thin in the patch that I'm not
completely sure about the pattern(s) to use.  The old pattern made it
consider anything with just a tilde in it to be interesting to expand.

Bye
  Sven

Index: Completion/Base/Completer/_expand
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Completer/_expand,v
retrieving revision 1.3
diff -u -r1.3 _expand
--- Completion/Base/Completer/_expand	2001/04/27 09:12:33	1.3
+++ Completion/Base/Completer/_expand	2001/04/30 11:06:20
@@ -34,7 +34,7 @@
 
 zstyle -T ":completion:${curcontext}:" suffix &&
   [[ "$word" = (\~*/|*\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|*\$\{*\}?) &&
-     "${(e)word}" != *[][^~*?\<\>\{\}\|]* ]] &&
+     "${(e)word}" != *[][^*?\(\)\<\>\{\}\|]* ]] &&
   return 1
 
 zstyle -t ":completion:${curcontext}:" accept-exact ||

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


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

* Re: PATCH: Re: Use of named directories in completions broken.
  2001-04-30 11:08 ` PATCH: " Sven Wischnowsky
@ 2001-04-30 11:19   ` Peter Stephenson
  2001-04-30 11:25     ` Sven Wischnowsky
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2001-04-30 11:19 UTC (permalink / raw)
  To: Zsh hackers list

> Yes, ahem, I said in a comment above the thin in the patch that I'm not
> completely sure about the pattern(s) to use.  The old pattern made it
> consider anything with just a tilde in it to be interesting to expand.

This works fine, but it would presumably be OK if the ~ in question were
only at the start of the word.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


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

* Re: PATCH: Re: Use of named directories in completions broken.
  2001-04-30 11:19   ` Peter Stephenson
@ 2001-04-30 11:25     ` Sven Wischnowsky
  0 siblings, 0 replies; 6+ messages in thread
From: Sven Wischnowsky @ 2001-04-30 11:25 UTC (permalink / raw)
  To: zsh-workers

Peter Stephenson wrote:

> > Yes, ahem, I said in a comment above the thin in the patch that I'm not
> > completely sure about the pattern(s) to use.  The old pattern made it
> > consider anything with just a tilde in it to be interesting to expand.
> 
> This works fine, but it would presumably be OK if the ~ in question were
> only at the start of the word.

I thought the same at first, couldn't immediately come up with a simple
enough pattern for that and then remembered that in `echo a~b' the `a~b'
isn't treated as a pattern unless there are other pattern characters,
too.  So, that change should be ok (now that I remembered to add the
parentheses to the pattern).

Bye
  Sven


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


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

* Re: Use of named directories in completions broken.
  2001-04-30 10:37 Use of named directories in completions broken Peter Stephenson
  2001-04-30 11:08 ` PATCH: " Sven Wischnowsky
@ 2001-04-30 15:47 ` Peter Stephenson
  2001-05-02  8:57   ` Sven Wischnowsky
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2001-04-30 15:47 UTC (permalink / raw)
  To: Zsh hackers list

Still having problems with this...

% echo ~dev/<TAB>

does menu completion as expected.

% echo ~dev/sr<TAB>

should complete to ~dev/src/ but expands instead (then does completion on
that the next time round).  Similar problem with plain ~/ .  Here's the
_expand part of the trace for the first example.  Should that pattern on
line 36 begin (~*/*| rather than (~*/| ?

+_expand:10> setopt localoptions nonomatch
+_expand:12> [[ _matcher_num -gt 1 ]]
+_expand:14> local exp word sort expr expl subd suf=  force opt asp tmp opre pre epre
+_expand:16> ((  0  ))
+_expand:21> [[ _main_complete == _prefix ]]
+_expand:24> word=~dev/sr 
+_expand:27> [[ ~dev/sr == *$(|{[^}]#) || ~dev/sr == *$[a-zA-Z0-9_]## ]]
+_expand:35> zstyle -T :completion::expand::: suffix
+_expand:36> [[ ~dev/sr == (~*/|*$(|[=~#^+])[a-zA-Z0-9_[]]##[^a-zA-Z0-9_[]]|*${*}?) ]]
+_expand:40> zstyle -t :completion::expand::: accept-exact
+_expand:41> [[ 2 -eq 2 && ! -o recexact ]]
+_expand:50> exp=( ~dev/sr ) 
+_expand:56> [[  == *s* ]]
+_expand:57> zstyle -T :completion::expand::: substitute
+_expand:58> [[ ! -o ignorebraces && 0 == 0 ]]
+_expand:59> eval exp=( \~dev/sr )
+_expand:59> exp=( ~dev/sr ) 
+_expand:60> eval exp=( ${${(e)exp//\\[ 	
]/ }//(#b)([ 	
])/\\$match[1]} )
+_expand:60> exp=( ~dev/sr ) 
+_expand:69> [[ -z ~dev/sr ]]
+_expand:71> subd=( ~dev/sr ) 
+_expand:75> [[  == *g* ]]
+_expand:75> zstyle -T :completion::expand::: glob
+_expand:76> eval exp=( ${~exp//(#b)\\[ 	
]/$match[1]} ); exp=( ${(q)exp} )
+_expand:76> exp=( /home/pws/bc01/bc01/dev/sr ) 
+_expand:76> exp=( /home/pws/bc01/bc01/dev/sr ) 
+_expand:85> ((  1  ))
+_expand:87> [[ 1 -eq 1 && /home/pws/bc01/bc01/dev/sr == ~dev/sr(|(N)) ]]
+_expand:92> [[  == *o* ]]
+_expand:93> zstyle -t :completion::expand::: subst-globs-only
+_expand:96> zstyle -s :completion::expand::: keep-prefix tmp
+_expand:96> tmp=changed 
+_expand:98> [[ ~dev/sr == (~*/*|*$*/*) && changed == (yes|true|on|1|changed) ]]
+_expand:99> [[ ~dev/sr == *$* ]]
+_expand:102> opre=~dev 
+_expand:104> eval epre=( ${(e)~opre} )
+_expand:104> epre=( /home/pws/bc01/bc01/dev ) 
+_expand:106> [[ -n /home/pws/bc01/bc01/dev && 1 -eq 1 ]]
+_expand:107> pre=/home/pws/bc01/bc01/dev 
+_expand:108> [[ changed != changed || 1 -gt 1 || ~dev/sr != ~dev/sr ]]
+_expand:111> [[ 1 -eq 1 && /home/pws/bc01/bc01/dev/sr == ~dev/sr ]]
+_expand:116> zstyle -s :completion::expand::: sort sort
+_expand:118> [[  == (yes|true|1|on) ]]
+_expand:120> zstyle -s :completion::expand::: add-space tmp
+_expand:126> asp=file 
+_expand:131> ((  1 == 1  ))
+_expand:132> [[ -d /home/pws/bc01/bc01/dev/sr ]]
+_expand:134> [[ file == yes* || file == *file && -f /home/pws/bc01/bc01/dev/sr ]]
+_expand:138> suf= 
+_expand:142> [[ -z menu ]]
+_expand:151> _tags all-expansions expansions original
+_expand:193> compstate[insert]=menu 
+_expand:196> return 0

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


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

* Re: Use of named directories in completions broken.
  2001-04-30 15:47 ` Peter Stephenson
@ 2001-05-02  8:57   ` Sven Wischnowsky
  0 siblings, 0 replies; 6+ messages in thread
From: Sven Wischnowsky @ 2001-05-02  8:57 UTC (permalink / raw)
  To: zsh-workers

Peter Stephenson wrote:

> Still having problems with this...
> 
> % echo ~dev/<TAB>
> 
> does menu completion as expected.
> 
> % echo ~dev/sr<TAB>
> 
> should complete to ~dev/src/ but expands instead (then does completion on
> that the next time round).  Similar problem with plain ~/ .  Here's the
> _expand part of the trace for the first example.  Should that pattern on
> line 36 begin (~*/*| rather than (~*/| ?

Ouch.  Yes.

Bye
  Sven

Index: Completion/Base/Completer/_expand
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Completer/_expand,v
retrieving revision 1.4
diff -u -r1.4 _expand
--- Completion/Base/Completer/_expand	2001/04/30 11:09:50	1.4
+++ Completion/Base/Completer/_expand	2001/05/02 08:57:18
@@ -33,7 +33,7 @@
 #  [[ "$word" = (\~*/|\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|\$\{*\}?)[^\$\{\}\(\)\<\>?^*#~]# ]] &&
 
 zstyle -T ":completion:${curcontext}:" suffix &&
-  [[ "$word" = (\~*/|*\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|*\$\{*\}?) &&
+  [[ "$word" = (\~*/*|*\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|*\$\{*\}?) &&
      "${(e)word}" != *[][^*?\(\)\<\>\{\}\|]* ]] &&
   return 1
 

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


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

end of thread, other threads:[~2001-05-02  8:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-30 10:37 Use of named directories in completions broken Peter Stephenson
2001-04-30 11:08 ` PATCH: " Sven Wischnowsky
2001-04-30 11:19   ` Peter Stephenson
2001-04-30 11:25     ` Sven Wischnowsky
2001-04-30 15:47 ` Peter Stephenson
2001-05-02  8:57   ` 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).