From mboxrd@z Thu Jan 1 00:00:00 1970 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes Date: Fri, 29 Jan 1999 09:31:40 +0100 (MET) Message-Id: <199901290831.JAA12458@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Sven Wischnowsky's message of Thu, 28 Jan 1999 17:49:08 +0100 (MET) Subject: Re: feature-request of double-tab-list X-Mailing-List: 5101 I wrote: > Bart Schaefer wrote: > > > Way way back on Sep 19, 5:36pm, Rasmus Tengblad wrote: > > } Subject: feature-request of double-tab-list > > } > > } First i'd like to tell you that I really like zsh. Best shell there is! > > } However, there is one small thing I like better about bash, and that's the > > } double-tab-press or what ever you'd want to call it. It's sort of like zsh > > } with AUTO_LIST set, but with the exception that you have to press tab > > } twice before the list is displayed. > > > > OK, Sven, can we implement this using the new completion stuff? What, if > > any, hooks are there for keeping track of the first vs. the second press > > of the completion key within the same completion? > > We could give free the zle-parameters (LBUFFER,...) in completion > widgets and then do something like: > > local lastl lastr > > if [[ "$LBUFFER" != "$lastl" || "$RBUFFER" != "$lastr" ]] then > lastl="$LBUFFER" > lastr="$RBUFFER" > return > fi > > We should make them readonly in completion widgets, though (since the > match-inserting code could get terribly confused otherwise). > > Would that be enough? No, for a correct solution this wouldn't be enough. For that we would need information about the last zle widget executed (the one *before* the one that is currently executing). This should be possible by adding another zle parameter (sister of BUFFER, CURSOR,...). Then, when we make those parameters readable in completion widgets, we can test if the last widget was the same as the current one. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de