From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1842 invoked from network); 16 Jun 1999 13:02:04 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 Jun 1999 13:02:04 -0000 Received: (qmail 16404 invoked by alias); 16 Jun 1999 13:01:13 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6661 Received: (qmail 16396 invoked from network); 16 Jun 1999 13:01:10 -0000 Message-ID: <4FBF540FF16FD1119D9600A0C94B2B51F29E8D@napier.logica.co.uk> From: "Kiddle, Oliver" To: "'zsh-workers@sunsite.auc.dk'" Subject: Re: history related suggestions Date: Wed, 16 Jun 1999 14:00:56 +0100 X-Mailer: Internet Mail Service (5.5.2448.0) Peter Stephenson wrote: > > Along with this, I would suggest that parameter expansion be > > done on the zle widget arguments each time the widget is run. This would > > allow users to do: > > bindkey '^[[A' up-line-or-history '$history_toggle' > > and then change the $history_toggle variable to select between local and > > shared history. > > That sort of thing should certainly be done inside functions. > Extra levels of expansion tend to make things a bit of a mess, and in my > experience you always get to the point where you need the extra flexibility > of a function anyway. (Cf. S. Wischnowsky, Collected New Completion Fair enough if it's hard to implement but my thinking was that it would allow a lot of problems to be solved more succinctly than by using a function. Bart Schaefer wrote: > } What I would also like is if these were numbered so that the most > } recent one is the same as $HISTSIZE. This would mean that when I first > } run zsh, the first command I type would be number 1, not 200. > How would you refer in bang-syntax to the commands that precede 1 ? They > can't be given negative numbers; !-10 already means ten commands before > the current command. They would be numbered from $HISTSIZE downwards so for example, if you have HISTSIZE=500 and SAVEHIST=100, they would be numbered from !401 to !500. I always thought it would be better if the history numbers wrapped back to 1 once they reached $HISTSIZE rather than carrying on into the thousands. What currently happens if $SAVEHIST is greater than $HISTSIZE? > You could accomplish that by completly flushing and reloading the history > from the shared file every time that the file changes, starting over at 1 > with the numbering each time -- but I think you'd rapidly find that it was > more annoying than useful: the number that a command had a moment ago > would no longer be the number it has now, so your reference to !4 might > get the wrong thing. Yup, that would be nasty. I mostly look at prompts back in my buffer for history numbers rather than the output of fc. Having thought about it a bit more, it would probably be quite hard to implement properly as shell's would have to reserve the history number once they printed a prompt so forget the suggestion. Cheers Oliver Kiddle