From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 684 invoked by alias); 30 Nov 2013 11:03:44 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18175 Received: (qmail 16501 invoked from network); 30 Nov 2013 11:03:37 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Message-ID: <5299C600.8040508@necoro.eu> Date: Sat, 30 Nov 2013 12:03:28 +0100 From: =?ISO-8859-1?Q?Ren=E9_=27Necoro=27_Neumann?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130925 Thunderbird/17.0.9 MIME-Version: 1.0 To: zsh-users@zsh.org Subject: Re: shared history but recalling history in current terminal References: <131127000208.ZM18878@torch.brasslantern.com> <52964328.5040801@necoro.eu> <131127170553.ZM23821@torch.brasslantern.com> <5297AB37.80504@necoro.eu> <131128133318.ZM25004@torch.brasslantern.com> In-Reply-To: <131128133318.ZM25004@torch.brasslantern.com> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Am 28.11.2013 22:33, schrieb Bart Schaefer: > On Nov 28, 9:44pm, René 'Necoro' Neumann wrote: > } Subject: Re: shared history but recalling history in current terminal > } > } Am 28.11.2013 02:05, schrieb Bart Schaefer: > } > zle-keymap-select() { > } > [[ $KEYMAP = isearch ]] > } > NUMERIC=$? zle set-local-history > } > } > } > } Hmm. Thanks. This works now in that there is no interleaving. But > } interleaving is not switched on when entering incremental search. > > Ah, fooey. The isearch keymap is never actually "selected", it's just > scanned by the incremental search widgets. > > Sorry for the wild goose chase. (At least it led us to the NUMERIC vs > command-line-argument issue.) > > So the right way to do this is actually > > zle-line-init() { NUMERIC=1 zle set-local-history } > zle -N zle-line-init > zle-isearch-update() { NUMERIC=0 zle set-local-history } > zle -N zle-isearch-update > zle-isearch-exit() { NUMERIC=1 zle set-local-history } > zle -N zle-isearch-exit > > Strictly speaking that runs set-local-history a lot more often than is > necessary, but doing so should be harmless. > This works, thank you very much. Perhaps one could add a zle-isearch-init widget? Strikes me odd, that there isn't one. - René