From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23410 invoked from network); 17 Sep 1999 21:45:01 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 17 Sep 1999 21:45:01 -0000 Received: (qmail 10551 invoked by alias); 17 Sep 1999 21:44:56 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7924 Received: (qmail 10544 invoked from network); 17 Sep 1999 21:44:56 -0000 Date: Fri, 17 Sep 1999 22:44:55 +0100 From: Adam Spiers To: zsh workers mailing list Subject: Re: simulation of dabbrev-expand Message-ID: <19990917224455.C3509@thelonious.new.ox.ac.uk> Reply-To: Adam Spiers Mail-Followup-To: zsh workers mailing list References: <19990909133913.A30055@thelonious.new.ox.ac.uk> <990909171104.ZM15814@candle.brasslantern.com> <19990916173409.A17932@thelonious.new.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i In-Reply-To: <19990916173409.A17932@thelonious.new.ox.ac.uk> X-URL: http://www.new.ox.ac.uk/~adam/ X-OS: Linux 2.2.9 i686 Adam Spiers, on thelonious (adam@thelonious.new.ox.ac.uk) wrote: > Bart Schaefer (schaefer@candle.brasslantern.com) wrote: > > On Sep 9, 1:39pm, Adam Spiers wrote: > > } It appears to always work fine when grabbing words from history added > > } by the current shell, but either doesn't work at all, or very > > } unreliably when you want to grab a word from the saved history. > > > > Can you perhaps give a more specific example? I'm not having any trouble > > with this at all. > > % history 1 | grep ' /' | wc -l > 650 > % less / > % less /usr/share/zsh/functions/_man > zsh: do you wish to see all 51 possibilities? > > Where did all the others go? [snip] > The newer entries work fine. This problem has > exhibited itself in exactly the same way across zsh-3.1.6-pws-* :-( I've done a lot of further investigation into this, and *still* cannot spot an exact pattern to when it does and doesn't work, which is unbelievably frustrating. However, I'm beginning to suspect that it may have something to do with history duplicates. Sven's latest patch to _history_complete_word is very nice, but if the `history_sort' configuration key is unset, no sorting occurs, and hence no removal of duplicates. (As we're talking about individual words extracted from the history, the options dealing with history line duplicates have little bearing on this.) How can I ensure that there are no duplicate words in the list of matches? Even if this isn't the real problem I'm experiencing, it may well help narrow it down. This questions leads me to another: we have all these variables at our disposal in the widget functions for examining the completion system's state in great detail ... but the one thing we still can't do (AFAICS) is actually see what completions have currently been calculated. If there was a special array parameter, `completions' say, then things like removing duplicate matches, or choosing your own match sorting algorithm (although heaven forbid I would ever need to implement a quicksort in zsh :-) would become possible in the shell functions. Have I missed something here? Adam