From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12944 invoked from network); 28 Jun 2000 09:03:10 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Jun 2000 09:03:10 -0000 Received: (qmail 19714 invoked by alias); 28 Jun 2000 09:02:52 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12099 Received: (qmail 19707 invoked from network); 28 Jun 2000 09:02:51 -0000 Date: Wed, 28 Jun 2000 11:02:49 +0200 (MET DST) Message-Id: <200006280902.LAA32220@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Wed, 28 Jun 2000 12:11:56 +0400 Subject: RE: PATCH: Re: undo in menu selection broken Andrej Borsenkow wrote: > > What this patch does *not* do is fix the behaviour of a-a-i-n-h when > > there is no match. I was thinking about making it just show some > > message and let undo bring you back. Or maybe let it stay in the > > selection it currently is in and show some message. But: > > I think, this is more general problem. I do not like what currently > happens, when no match is found. > > 1. There is hardly any visual feedback (well, with verbose style and > group names you get sort of). Good ole compctl had an option to display > a message in this case ... I do not recall something like this in new > completion system. Is there any style I can set to simply display "No > matches found" in this case? > > 2. Something very funny happens if there is no matches and you hit TAB > several times. The worst is, that line is erased. This hapens in menu > selection and in normal completion as well. Consider: This was only a problem with _oldlist. Should be fixed by the patch below. > > 1) I wouldn't like to hard-wire this message, but adding a parameter > > just for this looks kinda weird. > > Or maybe just add a ZLS_COLOURS capability for it. > > See above. Style for general use is really welcome (not only for this > one widget) Maybe you should just have had a look at the docs after I wrote: > > 2) Setting the format style for the warnings tag to a value without a > > `%d' makes it add the descriptions of the things it tried as > > matches which gives a much better output than using `%d'. But with > > this, there's never a completion without matches and a-a-i-n-h > > happily starts completing the descriptions. So maybe a-a-i-n-h > > in menu-selection should set some parameter so that the shell code > > can find that out. Even better would be to change the complete > > module so that other modules like complist can put things into > > $compstate. > > Ahem ... sorry, but I simply do not understand it :-)) I'm speaking from > a user's point if view ... Currently you can use: zstyle ':completion:*:warnings' format 'No matches for: %d' which gives you only the explanation. Or you can use: zstyle ':completion:*:warnings' format 'No matches for:' (note: no `%d') which gives you that explanation and below that the list of descriptions for the things it tried to complete. So, there is currently no way to make it *not* display the descriptions. Hm, maybe, the no-`%d' is used seldom enough to allow us to make the `add descriptions as "matches"' be controlled by another style. But it's cheap, showing those descriptions. All the work for it is already done. Bye Sven Index: Completion/Core/_oldlist =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_oldlist,v retrieving revision 1.6 diff -u -r1.6 _oldlist --- Completion/Core/_oldlist 2000/05/18 08:59:29 1.6 +++ Completion/Core/_oldlist 2000/06/28 08:56:56 @@ -1,6 +1,6 @@ #autoload -[[ _matcher_num -gt 1 ]] && return 1 +[[ _matcher_num -gt 1 || $_lastcomp[nmatches] -eq 0 ]] && return 1 local list -- Sven Wischnowsky wischnow@informatik.hu-berlin.de