Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: search through alternative HISTFILE
- X-seq: zsh-users 17912
- From: Maarten Grachten <maarten.grachten@xxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: search through alternative HISTFILE
- Date: Tue, 06 Aug 2013 16:09:42 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=j1LIY4grBEv0Y9nJ1oL65R3Ly0pfz7gC2cIwxRv5p3c=; b=cZGB5mdXUyjhBuN1q7lTBIJqhoZwquXyiHfX2BF8gjMW9LIJvMUzfmjmJNixliUbr7 hBdziST7JPkxSwVISSmQEr19tBp3DRBvC1YbssFx+G7gljfgrq4ZOaWC5rjHH7S7/UVV yWTLohhVByUPiy2hvVTBPGYLc6ZAZyHc+40L05bRbiKBqt5CuakupTifGh/7GRFN1RII N7Rzq6YysrMuPdWVq9a/0Nw6mKZ1dMTsbPNVykAPet7j8mp8AmhxDs+h3ktBZchgr330 TDKXCZ9JaF2jjCri3iHqv/Cnhesg0SnexHPviarKIsZ7nAqdezsaCJeViOn7Dqcxd9EU 75RA==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Sender: Maarten Grachten <maarten.grachten@xxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author