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

Explanation for no completion candidates.



Hi. I found that zsh 3.1.4 does not output a explanation given with
"-X" for compctl when there is no completion candidates.

% compctl -X explanation tst
% tst<Tab>

zsh-3.0.5 prints "explanation"
zsh-3.1.4 prints nothing

I think following patch fix this.
------------------------------------------------------------
--- Src/Zle/zle_tricky.c-	Tue Oct 13 00:37:17 1998
+++ Src/Zle/zle_tricky.c	Tue Oct 13 00:37:30 1998
@@ -2202,6 +2202,7 @@
 	    }
 	}
 
+      compend:
 	/* Print the explanation string if needed. */
 	if (!showinglist && expl && nmatches != 1) {
 	    int up;
@@ -2222,7 +2223,6 @@
 		putc('\n', shout);
 	    fflush(shout);
 	}
-      compend:
 	ll = strlen((char *)line);
 	if (cs > ll)
 	    cs = ll;
------------------------------------------------------------

However, zsh-3.0.5 and zsh-3.1.4 has different behavior on "-X". So
this patch does not provide perfect compatibility between 3.05 and
3.1.4.

% compctl -X ex1 + -X ex2 tst
% tst<Tab>

zsh-3.0.5 prints "ex1"
zsh-3.1.4 with this patch prints "ex2"
-- 
[Tanaka Akira]



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