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

Re: compctl -X



> I sent this some time ago, it seems to have disappeared...
> 
> `compctl -X explanation' should print the explanation if there *are*
> matching completions, not if there aren't.  If the type of matching
> wasn't used, you don't care; if it was, you want to know why.

It depends how do you use compctl -X.  I used in in exatly the opposite
way: for example for dd, I complete filenames after if= but when I hit
TAB after bs= zsh will print <number> (see Misc/compctl-examples), and
that's always worked at least since zsh-2.5.  Older versions had an
nmatches != 1 test here: if there is a unique completion, do it and do
not disturb the user.  If there are no or more than one completions,
explain.  It was an oversight from me (that I made last August, almost a
year ago) to change it.  The patch below restores the original behaviour.

Zoltan


*** Src/Zle/zle_tricky.c	1997/06/16 05:20:01	3.1.3.1
--- Src/Zle/zle_tricky.c	1997/08/05 06:35:44
***************
*** 2127,2136 ****
  	}
  
  	/* Print the explanation string if needed. */
! 	if (!showinglist && expl && !nmatches) {
  	    int up;
  
! 	    feep();
  	    trashzle();
  
  	    clearflag = (isset(USEZLE) && !termflags &&
--- 2127,2137 ----
  	}
  
  	/* Print the explanation string if needed. */
! 	if (!showinglist && expl && nmatches != 1) {
  	    int up;
  
! 	    if (!nmatches)
! 		feep();
  	    trashzle();
  
  	    clearflag = (isset(USEZLE) && !termflags &&



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