From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18475 invoked by alias); 12 Apr 2015 12:41:00 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20143 Received: (qmail 5646 invoked from network); 12 Apr 2015 12:40:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_NUMERIC_HELO,SPF_HELO_PASS,T_FSL_HELO_BARE_IP_2 autolearn=no version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: Yuri D'Elia Subject: Re: show-ambiguity style Date: Sun, 12 Apr 2015 14:40:36 +0200 Message-ID: <552A67C4.1080903@thregr.org> References: <150411130249.ZM27498@torch.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.106.183.18 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 In-Reply-To: <150411130249.ZM27498@torch.brasslantern.com> On 04/11/2015 10:02 PM, Bart Schaefer wrote: > Completion gets screwed up if show-ambiguity is not an ANSI term color > attribute or one of the "true" strings (which by the way means you can't > use boldface because "1" means "true" and is therefore replaced with "4" > for underlining, but you can use e.g. "1;7" for "bold reverse video"). I mentioned it in the page (and now that I look again, you actually responded to my first implementation ;)). show_ambiguity is bolted on list-colors. I started approaching it just as completer widget. Since it just accepts a pattern to be fed to list colors, my setting is actually more interesting(tm): zstyle ':completion:*' show-ambiguity "1;4:=*=0" I use bold-underline (not shown in the video), and the extra =*=0 pattern is used as a fallback match to clear any coloring. That is, if there is no match, I don't want any color. > Anyway, the point is there could be more internal sanity checking that > the string that is output is going to make sense, but there currently is > not, so use caution. The way the match is constructed (a nested glob expression - a great idea of Oliver Kiddle) is the neatest and weakest part IMHO. It makes the highlight work even with complete_in_word, but surely is not as efficient as post-processing the result *after* list coloring. It would make sense to decouple show-ambiguity from file coloring. This would enable to have both on, and avoid keeping extra state. But again, show_ambiguity is not very well known. After seeing it in emacs, I *had* to have it on zsh.