zsh-users
 help / color / mirror / code / Atom feed
* auto-completion with exact match
@ 2008-11-22 19:55 Rémi Prévost
  2008-11-22 20:39 ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Rémi Prévost @ 2008-11-22 19:55 UTC (permalink / raw)
  To: zsh-users

I've asked this question two times in irc but no one seemed to have
found answer.

I have those two directories in my home directory: .gnome2/
and .gnome2_private.

When I type "cd .gnome2<TAB>", it first completes to "cd .gnome2/" but
then if I type <TAB> again, it auto-completes with the directories
*inside* ".gnome2/". I would expect it to offer me to complete between
".gnome2/" and ".gnome2_private/".

Can this behavior be configured differently?


- Rémi Prévost


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

* Re: auto-completion with exact match
  2008-11-22 19:55 auto-completion with exact match Rémi Prévost
@ 2008-11-22 20:39 ` Bart Schaefer
  2008-11-22 20:44   ` Rémi Prévost
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2008-11-22 20:39 UTC (permalink / raw)
  To: zsh-users

On Nov 22,  2:55pm, Rémi Prévost wrote:
}
} When I type "cd .gnome2<TAB>", it first completes to "cd .gnome2/" but
} then if I type <TAB> again, it auto-completes with the directories
} *inside* ".gnome2/". I would expect it to offer me to complete between
} ".gnome2/" and ".gnome2_private/".

Do you perhaps have the REC_EXACT setopt turned on?


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

* Re: auto-completion with exact match
  2008-11-22 20:39 ` Bart Schaefer
@ 2008-11-22 20:44   ` Rémi Prévost
  2008-11-22 23:53     ` Kazuo Teramoto
  0 siblings, 1 reply; 7+ messages in thread
From: Rémi Prévost @ 2008-11-22 20:44 UTC (permalink / raw)
  To: zsh-users

Le samedi 22 novembre 2008 à 12:39 -0800, Bart Schaefer a écrit :
> On Nov 22,  2:55pm, Rémi Prévost wrote:
> }
> } When I type "cd .gnome2<TAB>", it first completes to "cd .gnome2/" but
> } then if I type <TAB> again, it auto-completes with the directories
> } *inside* ".gnome2/". I would expect it to offer me to complete between
> } ".gnome2/" and ".gnome2_private/".
> 
> Do you perhaps have the REC_EXACT setopt turned on?

Yep, I unset it and it's working as expected. Thank you very much!

- Rémi


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

* Re: auto-completion with exact match
  2008-11-22 20:44   ` Rémi Prévost
@ 2008-11-22 23:53     ` Kazuo Teramoto
  2008-11-23  4:52       ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Kazuo Teramoto @ 2008-11-22 23:53 UTC (permalink / raw)
  To: zsh-users

On Sat, Nov 22, 2008 at 6:44 PM, Rémi Prévost <remi@exomel.com> wrote:
>
> Yep, I unset it and it's working as expected. Thank you very much!
>
> - Rémi

Hi, I have similar problem but RECEXACT dont solved it. The problems
only happen with rm...

If I have two dirs or files names 'wine' and 'winet' and type 'rm -rf
win' and hit tab it complete to wine if I hit tab one more time it
complete to winet but if I hit tab again it dont go back to wine or to
win.

But if any other program ln, touch, ls... on the second tab hit I get a:

---- files
wine/   winet/

And can cycle between wine and winet.

That happened only on recent versions (I'm using 4.3.9) and I dont
changed my zshrc.

Someone know what is wrong?

-- 
«Dans la vie, rien n'est à craindre, tout est à comprendre»
Marie Sklodowska Curie.

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

* Re: auto-completion with exact match
  2008-11-22 23:53     ` Kazuo Teramoto
@ 2008-11-23  4:52       ` Bart Schaefer
  2008-11-23 12:24         ` Kazuo Teramoto
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2008-11-23  4:52 UTC (permalink / raw)
  To: zsh-users

On Nov 22,  9:53pm, Kazuo Teramoto wrote:
}
} If I have two dirs or files names 'wine' and 'winet' and type 'rm -rf
} win' and hit tab it complete to wine if I hit tab one more time it
} complete to winet but if I hit tab again it dont go back to wine or to
} win.

Does this only happen with "-rf" or is it independent of options to rm?
} 
} But if any other program ln, touch, ls... on the second tab hit I get a:
} 
} ---- files
} wine/   winet/
} 
} And can cycle between wine and winet.

You must have a zstyle of some kind for "rm", because it has no special
completion function; "ls" has a completion function, but neither "ln"
nor "touch" does, so e.g. "rm" and "ln" should behave the same.

Quite a number of completion bugs or misbehaviors were fixed for 4.3.9
so your configuration might very well behave differently (see earlier
thread about changes in completion for "..").

For starters, compare

% ln <ctrl-x>h

with

% rm <ctrl-x>h

I'd expect the output to be identical in both cases.


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

* Re: auto-completion with exact match
  2008-11-23  4:52       ` Bart Schaefer
@ 2008-11-23 12:24         ` Kazuo Teramoto
  2008-11-23 18:15           ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Kazuo Teramoto @ 2008-11-23 12:24 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

On Sun, Nov 23, 2008 at 2:52 AM, Bart Schaefer
<schaefer@brasslantern.com> wrote:
>
> Does this only happen with "-rf" or is it independent of options to rm?
Independent. The same behavior without -rf

> % ln <ctrl-x>h
Produce a list of options to complete like ls. With and without a
start arg (e.g. with 'ln win' I get a list 'wine winet' and can cycle
between the options)

> % rm <ctrl-x>h
Without any arg it produce a identical output like ln and ls (I list
of all files/dirs) but with args (e.g. 'rm win') the result is
different of ln and ls (it complete to wine and on next hit winet
without a list of options to cycle)

Thanks,
Kazuo Teramoto

-- 
«Dans la vie, rien n'est à craindre, tout est à comprendre»
Marie Sklodowska Curie.

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

* Re: auto-completion with exact match
  2008-11-23 12:24         ` Kazuo Teramoto
@ 2008-11-23 18:15           ` Bart Schaefer
  0 siblings, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2008-11-23 18:15 UTC (permalink / raw)
  To: Kazuo Teramoto; +Cc: zsh-users

On Nov 23, 10:24am, Kazuo Teramoto wrote:
}
} > % ln <ctrl-x>h
} Produce a list of options to complete like ls. With and without a
} start arg (e.g. with 'ln win' I get a list 'wine winet' and can cycle
} between the options)

No, you misunderstand.  I mean really do type a control-x and an h.
You should see something like this:

% ln
tags in context :completion::complete:ln::
    globbed-files  (_files _default (eval))
% rm
tags in context :completion::complete:rm::
    argument-rest options  (_arguments _rm (eval))

I just realized that when I looked at this before, I was using an
older version of zsh.  There now is a completion function _rm, and
I'm able to reproduce the behavior you described.  This function
was introduced at the beginning of October of this year.

The fix seems to be to change the direct call to _path_files in _rm
to instead call _files and let it manage looping on _path_files.

--- ../zsh-forge/current/Completion/Unix/Command/_rm    2008-10-08
04:37:34.000000000 -0700
+++ Completion/Unix/Command/_rm 2008-11-23 10:03:34.000000000 -0800
@@ -34,7 +34,7 @@
   (file)
     declare -a ignored
     ignored=(${line//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
-    _path_files -F ignored && ret=0
+    _files -F ignored && ret=0
     ;;
 esac
 


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

end of thread, other threads:[~2008-11-23 18:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-22 19:55 auto-completion with exact match Rémi Prévost
2008-11-22 20:39 ` Bart Schaefer
2008-11-22 20:44   ` Rémi Prévost
2008-11-22 23:53     ` Kazuo Teramoto
2008-11-23  4:52       ` Bart Schaefer
2008-11-23 12:24         ` Kazuo Teramoto
2008-11-23 18:15           ` Bart Schaefer

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