From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10564 invoked by alias); 5 Dec 2009 19:32:02 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27466 Received: (qmail 6695 invoked from network); 5 Dec 2009 19:31:49 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received-SPF: pass (ns1.primenet.com.au: SPF record at ntlworld.com designates 81.103.221.48 as permitted sender) Date: Sat, 5 Dec 2009 19:31:41 +0000 From: Peter Stephenson To: zsh workers Subject: Re: Add completion suffix highlighting Message-ID: <20091205193141.036672b7@pws-pc> In-Reply-To: <237967ef0912041353g2ff47fa8m9dd274ed8b37511@mail.gmail.com> References: <237967ef0912041353g2ff47fa8m9dd274ed8b37511@mail.gmail.com> X-Mailer: Claws Mail 3.7.3 (GTK+ 2.16.6; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=ZtHxNT4mZm3rCuM0SmWmgWxeBwJsziC8EqOrwwVkrhA= c=1 sm=0 a=pGLkceISAAAA:8 a=NLZqzBF-AAAA:8 a=YtRwUMjh_5rIqRlKDy0A:9 a=RBYAH2uvyAnHwxSH8R4A:7 a=_2r8hXWauxe3pC6SmmmUzt1K0JAA:4 a=MSl-tDqOz04A:10 a=_dQi-Dcv4p4A:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 On Fri, 4 Dec 2009 22:53:58 +0100 Mikael Magnusson wrote: > I have a friend who just started using zsh a while ago, and she > complained about / being removed when she pressed enter after > completing a directory to rsync. Apparently rsync behaves differently > with and without the / in place. We tried setting > ZLE_REMOVE_SUFFIX_CHARS to nothing and using zle auto-suffix-retain in > an accept-line hook, but then we realized it would be better if you > could tell more easily if the suffix would be removed or not. So I > whipped this up and somehow it worked on the first try (no guarantees > though :). Given my poor track record of posting patches via email, > here is a link to the patch, and I'll just paste in the essence of the > patch for reference. I'll commit this as it is with the following documentation and see what happens---I think highlighting removable suffixes is actually quite intuitive. Note, however, there are a lot of cases in which bold fonts aren't supported. Thanks. Index: Doc/Zsh/zle.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/zle.yo,v retrieving revision 1.80 diff -u -r1.80 zle.yo --- Doc/Zsh/zle.yo 17 Apr 2009 15:26:46 -0000 1.80 +++ Doc/Zsh/zle.yo 5 Dec 2009 19:29:55 -0000 @@ -2163,6 +2163,17 @@ representation but are shown in a special manner by the line editor. These characters are described below. ) +cindex(completion removable suffix, highlighting) +cindex(suffix, highlighting removable, in completion) +cindex(removable suffix, highlighting in completino) +item(tt(suffix)))( +This context is used in completion for characters that are +marked as suffixes that will be removed if the completion ends +at that point, the most obvious example being a slash (tt(/)) after +a directory name. Note that suffix removal is configurable; the +circumstances under which the suffix will be removed may differ +for different completions. +) enditem() tt(zle_highlight) may contain additional fields for controlling how @@ -2235,6 +2246,7 @@ ) item(tt(bold))( The characters in the given context are shown in a bold font. +Not all terminals distinguish bold fonts. ) item(tt(standout))( The characters in the given context are shown in the terminal's standout @@ -2280,7 +2292,7 @@ context, the defaults applied are equivalent to example(zle_highlight=LPAR()region:standout special:standout -isearch:underline+RPAR()) +suffix:bold isearch:underline+RPAR()) i.e. both the region and special characters are shown in standout mode. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/