zsh-workers
 help / color / mirror / code / Atom feed
From: "Kiddle, Oliver" <KiddleO@logica.com>
To: "'zsh-workers@sunsite.auc.dk'" <zsh-workers@sunsite.auc.dk>
Subject: Re: history related suggestions
Date: Wed, 16 Jun 1999 14:00:56 +0100	[thread overview]
Message-ID: <4FBF540FF16FD1119D9600A0C94B2B51F29E8D@napier.logica.co.uk> (raw)

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


             reply	other threads:[~1999-06-16 13:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-16 13:00 Kiddle, Oliver [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-06-16 13:07 Sven Wischnowsky
1999-06-15 13:10 Kiddle, Oliver
1999-06-15 15:27 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FBF540FF16FD1119D9600A0C94B2B51F29E8D@napier.logica.co.uk \
    --to=kiddleo@logica.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).