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

PATCH: bashautolist and automenu



The combination of the two stopped working some time ago, it seems.
this should fix it.

Bye
 Sven

Index: Src/Zle/compcore.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compcore.c,v
retrieving revision 1.4
diff -u -r1.4 compcore.c
--- Src/Zle/compcore.c	2000/04/04 11:26:26	1.4
+++ Src/Zle/compcore.c	2000/04/10 07:59:29
@@ -776,8 +776,9 @@
 		}
 	    }
 	}
-	startauto = (compinsert &&
-		     !strcmp(compinsert, "automenu-unambiguous"));
+	startauto = ((compinsert &&
+		      !strcmp(compinsert, "automenu-unambiguous")) ||
+		     (bashlistfirst && (!compinsert || !*compinsert)));
 	useexact = (compexact && !strcmp(compexact, "accept"));
 
 	if (!comptoend || !*comptoend)
Index: Src/Zle/compresult.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compresult.c,v
retrieving revision 1.2
diff -u -r1.2 compresult.c
--- Src/Zle/compresult.c	2000/04/01 20:49:48	1.2
+++ Src/Zle/compresult.c	2000/04/10 07:59:30
@@ -665,7 +665,9 @@
 	 * 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.                          */
-	if (uselist == 3 && la) {
+	if ((uselist == 3 ||
+	     (!uselist && isset(BASHAUTOLIST) && isset(LISTAMBIGUOUS))) &&
+	    la) {
 	    int fc = fromcomp;
 
 	    invalidatelist();
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.1.1.102
diff -u -r1.1.1.102 zle_tricky.c
--- Src/Zle/zle_tricky.c	2000/03/14 09:43:53	1.1.1.102
+++ Src/Zle/zle_tricky.c	2000/04/10 07:59:30
@@ -136,7 +136,7 @@
  * lastambig == 2.                                                    */
 
 /**/
-mod_export int lastambig;
+mod_export int lastambig, bashlistfirst;
 
 /* Arguments for and return value of completion widget. */
 
@@ -184,7 +184,9 @@
     else {
 	int ret;
 	if (lastambig == 1 && isset(BASHAUTOLIST) && !usemenu && !menucmp) {
+	    bashlistfirst = 1;
 	    ret = docomplete(COMP_LIST_COMPLETE);
+	    bashlistfirst = 0;
 	    lastambig = 2;
 	} else
 	    ret = docomplete(COMP_COMPLETE);
@@ -258,7 +260,9 @@
     else {
 	int ret;
 	if (lastambig == 1 && isset(BASHAUTOLIST) && !usemenu && !menucmp) {
+	    bashlistfirst = 1;
 	    ret = docomplete(COMP_LIST_COMPLETE);
+	    bashlistfirst = 0;
 	    lastambig = 2;
 	} else
 	    ret = docomplete(COMP_EXPAND_COMPLETE);

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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