Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: zsh-3.1.5-pws-6: bash-style completion



Sven Wischnowsky wrote:
> > I've also been having strange effects when combining all this with:
> >   compctl -M 'm:{a-z}={A-Z}' 'r:|[.,_-]=* r:|=*'
> 
> Hm, I haven't found any unusual behavior here, so I guess, I need an
> example.

The following alone works for me, in the Src directory of the
distribution where z<TAB> is ambiguous.

% zsh -f
% compctl -M 'm:{a-z}={A-Z}' 'r:|[.,_-]=* r:|=*'
% echo z<TAB>
       ^cursor is now over the z.

Now delete the line with ^U, enter `compctl -M', and try the same
example again, and the shell dies.

> I have only a bash-2.01.1 here but that version shows the behavior to
> list the matches only on the third TAB: 1) insert unambiguous prefix,
> 2) do nothing, 3) show list. If the unambiguous prefix was completely
> typed (not automatically inserted), it first does nothing and shows
> the list on the second TAB. So I'd vote for removing the test, see the 
> patch below which also fixes a typo in your patch. Otherwise using
> BASHAUTOLIST will be the same as LISTAMBIGUOUS+AUTOLIST if the
> unambiguous prefix had to be automatically inserted.

That's fine by me; you can unset LISTAMBIGUOUS to get the other
behaviour.  The patch changes the documentation.

However, I'm having problems with LISTAMBIGUOUS when RECEXACT is set,
because `am' then gets set a few lines above that, apparently even if
there isn't an exact completion, and the chunk in question is skipped.
Any ideas?

--- Doc/Zsh/options.yo.2t2	Thu Feb  4 11:45:49 1999
+++ Doc/Zsh/options.yo	Thu Feb  4 15:06:20 1999
@@ -155,9 +155,9 @@
 item(tt(BASH_AUTO_LIST))(
 On an ambiguous completion, automatically list choices when the
 completion function is called twice in succession.  This takes
-precedence over tt(AUTO_LIST) and tt(LIST_AMBIGUOUS).  If
-tt(AUTO_MENU) is set, the menu behaviour will then start with the
-third press.
+precedence over tt(AUTO_LIST).  The setting of tt(LIST_AMBIGUOUS) is
+respected.  If tt(AUTO_MENU) is set, the menu behaviour will then start
+with the third press.
 )
 pindex(BEEP)
 cindex(beep, enabling)
@@ -497,10 +497,12 @@
 cindex(ambiguous completion)
 cindex(completion, ambiguous)
 item(tt(LIST_AMBIGUOUS))(
-This option works when tt(AUTO_LIST) is also set.  If there is an
-unambiguous prefix to insert on the command line, that is done without
-a completion list being displayed; in other words, auto-listing
-behaviour only takes place when nothing would be inserted.
+This option works when tt(AUTO_LIST) or tt(BASH_AUTO_LIST) is also
+set.  If there is an unambiguous prefix to insert on the command line,
+that is done without a completion list being displayed; in other
+words, auto-listing behaviour only takes place when nothing would be
+inserted.  In the case of tt(BASH_AUTO_LIST), this means that the list
+will be delayed to the third call of the function.
 )
 pindex(LIST_BEEP)
 cindex(beep, ambiguous completion)
--- Src/Zle/zle_tricky.c.2t2	Thu Feb  4 14:51:56 1999
+++ Src/Zle/zle_tricky.c	Thu Feb  4 15:02:28 1999
@@ -5479,11 +5479,7 @@
 	 * if the completion is completely ambiguous') is set, and some    *
 	 * prefix was inserted, return now, bypassing the list-displaying  *
 	 * code.  On the way, invalidate the list and note that we don't   *
-	 * want to enter an AUTO_MENU imediately.                          *
-	 *                                                                 *
-	 * We don't do this when BASH_AUTO_LIST is set, because that would *
-	 * mean you only got a completion list the third time you hit tab  *
-	 * (or whichever key).                                             */
+	 * want to enter an AUTO_MENU imediately.                          */
 	if(isset(LISTAMBIGUOUS) && !am &&
 	   (ics != cs || (ainfo->suflen && !atend))) {
 	    invalidatelist();


-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author