zsh-workers
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayned@users.sourceforge.net>
To: Danek Duvall <duvall@emufarm.org>
Cc: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: history editing
Date: Wed, 21 Nov 2001 14:21:33 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.21.0111211350030.25494-100000@life.blorf.net> (raw)
In-Reply-To: <20011116100106.A944@lorien.emufarm.org>

On Fri, 16 Nov 2001, Danek Duvall wrote:
> My normal course is to delete the last few lines of the history.  And
> while they disappear from the end of the history, they reappear at the
> beginning.  Re-running the function -- where those lines don't appear in
> the editor at all -- makes them disappear entirely.

This seems like the proper thing for your cited function to do.  I'm
assuming you have SAVEHIST and HISTSIZE set to the same value, right?
To see how this works, assume that this value is 100.  You edit the file
down to 97 lines by removing the last 3 lines and then load the history
file.  This pushes the 97 lines onto the history, and the first 3 still
remain up at the top.  If you repeat the sequence, they get pushed off
into oblivion by the re-reading of the same 97 lines.

So, there's nothing wrong with how your function works that I can see.
You could change it to discard the old history if you wanted to, though:

edh() {
    local histfile histsize

    histfile=${HISTFILE:-$HOME/.zshist}
    histsize=$HISTSIZE

    fc -AI $histfile
    vi + $histfile
    HISTSIZE=0
    HISTSIZE=$histsize
    fc -R $histfile
}

..wayne..


  parent reply	other threads:[~2001-11-21 22:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-16 17:27 Local history Peter Stephenson
2001-11-16 17:54 ` Oliver Kiddle
2001-11-16 18:01 ` Danek Duvall
2001-11-19  8:40   ` Wischnowsky, Sven
2001-11-19 16:48     ` Bart Schaefer
2001-11-19 17:36       ` Peter Stephenson
2001-11-19 17:58         ` Bart Schaefer
2001-11-21 18:57       ` history editing Danek Duvall
2001-11-21 22:21   ` Wayne Davison [this message]
2001-11-21 22:30     ` Danek Duvall

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=Pine.LNX.4.21.0111211350030.25494-100000@life.blorf.net \
    --to=wayned@users.sourceforge.net \
    --cc=duvall@emufarm.org \
    --cc=zsh-workers@sunsite.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).