zsh-users
 help / color / mirror / code / Atom feed
From: Maarten Grachten <maarten.grachten@ofai.at>
To: zsh-users@zsh.org
Subject: Re: search through alternative HISTFILE
Date: Tue, 06 Aug 2013 16:09:42 +0200	[thread overview]
Message-ID: <520103A6.9070905@ofai.at> (raw)

Hi, last update, hopefully.

I found out that when I just append several history files to generate 
ACC_HISTFILE, setting HISTNO to the number of lines (+1) in 
ACC_HISTFILE, does not necessarily point zle to the end of the history. 
I am not sure why this happens (maybe it has to do with duplicate 
removals in the internal history representation?). If the value of 
HISTNO set in this way turns out to be invalid, it seems to be reset to 
its original value. I think the correct way to deal with this is to use 
the end-of-history widget to move to the end of the newly loaded history.

The resulting widget is then like this:

function accumulated-history-incremental-search-backward () {
     fc -p $ACC_HISTFILE
     zle .end-of-history
     zle .history-incremental-search-backward
     fc -P
     zle .end-of-history
}

Maarten


             reply	other threads:[~2013-08-06 14:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-06 14:09 Maarten Grachten [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-08-06 10:11 Maarten Grachten
2013-08-06 11:05 ` Peter Stephenson
2013-08-06  9:55 Maarten Grachten
2013-08-05 10:05 Maarten Grachten
2013-08-05 18:52 ` Peter Stephenson
2013-08-02 10:38 Maarten Grachten
2013-08-02 11:08 ` 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=520103A6.9070905@ofai.at \
    --to=maarten.grachten@ofai.at \
    --cc=zsh-users@zsh.org \
    /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).