From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4709 invoked from network); 23 Mar 2005 12:05:42 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Mar 2005 12:05:42 -0000 Received: (qmail 40811 invoked from network); 23 Mar 2005 12:05:36 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Mar 2005 12:05:36 -0000 Received: (qmail 26347 invoked by alias); 23 Mar 2005 12:05:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21057 Received: (qmail 26337 invoked from network); 23 Mar 2005 12:05:33 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 23 Mar 2005 12:05:33 -0000 Received: (qmail 40513 invoked from network); 23 Mar 2005 12:05:32 -0000 Received: from vms046pub.verizon.net (206.46.252.46) by a.mx.sunsite.dk with SMTP; 23 Mar 2005 12:05:29 -0000 Received: from candle.brasslantern.com ([4.11.1.68]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IDT00F6H0909DP1@vms046.mailsrvcs.net> for zsh-workers@sunsite.dk; Wed, 23 Mar 2005 06:05:25 -0600 (CST) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j2NC5MLL015281; Wed, 23 Mar 2005 04:05:23 -0800 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j2NC5LfC015280; Wed, 23 Mar 2005 04:05:21 -0800 Date: Wed, 23 Mar 2005 12:05:18 +0000 From: Bart Schaefer Subject: Re: dabbrev like feature for zsh In-reply-to: =?iso-8859-1?Q?=3Cm03bumzufa=2Efsf=40PCHAGSREI=2Emsc-ge=2Ecom?= =?iso-8859-1?Q?=3E?= =?iso-8859-1?Q?Comments=3A_In_reply_to_Stefan_Reich=F6r_=3Cstefan=40xstev?= =?iso-8859-1?Q?e=2Eat=3E?= =?iso-8859-1?Q?________=22dabbrev_like_feature_for_zsh=22_=28Mar_23=2C__8?= =?iso-8859-1?Q?=3A35am=29?= To: zsh-workers@sunsite.dk Cc: =?iso-8859-1?Q?Stefan_Reich=F6r?= Message-id: <1050323120519.ZM15277@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable References: X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 On Mar 23, 8:35am, Stefan Reich=F6r wrote: } Subject: dabbrev like feature for zsh } } By googling I found the following settings: Don't believe everything you Google. } zstyle ':completion:*:history-words' stop yes } zstyle ':completion:*:history-words' list false Those two are OK (though probably for the wrong reason), but ... } zstyle ':completion:*:history-words' remove-all-dups yes } zstyle ':completion:*:history-words' menu yes =2E.. those two are wrong. } The remove-all-dups should remove the duplicated entries - shouldn't it= ? It does, if you use the right context. The reason this is so odd is because the first two styles are for the _history_complete_word widget itself; if written out more fully, they would be: zstyle ':completion:history-words:*:history-words' stop yes zstyle ':completion:history-words:*:history-words' list false Thus, "when completing history words using the special widget that only completes history words, don't cycle the history and don't list." However, you have to read the style right-to-left and the sentence left- to-right. "When completing history words" is the :history-words on the end of the style, and "using the special widget" is in the middle. I'm not sure why the _history_complete_word widget bothers to append that extra qualifier to the end of the context -- what else might it be completing, if not history words? -- but it does. The other two styles are not defined by the widget, they're defined by the _history completer which can be used in other places in completion Those styles don't have the extra :history-words on the end, which is perhaps something that should be changed in _history, but thus it is. zstyle ':completion:history-words:*' remove-all-dups yes zstyle ':completion:history-words:*' menu yes "When completing anything using the using the special widget that only completes history words, remove all duplicate history words and use menu completion." There, the "duplicate history words" (rather than duplicates in general) is implicit, because the only completer that recognizes remove-all-dups is the one that generates history words as possible matches. This is contrasted with: zstyle ':completion:*' remove-all-dups yes "When completing anything for any reason, remove all duplicate history words." By using ":completion:history-words:*" you would choose to have duplicate= history words removed when using M-/ but NOT removed when using TAB, if you ever added _history to your completer zstyle. Confused enough yet?