From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4564 invoked by alias); 28 Nov 2013 20:45:04 -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: 18173 Received: (qmail 366 invoked from network); 28 Nov 2013 20:44:48 -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: <5297AB37.80504@necoro.eu> Date: Thu, 28 Nov 2013 21:44:39 +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> In-Reply-To: <131127170553.ZM23821@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 02:05, schrieb Bart Schaefer: > On Nov 27, 8:08pm, René 'Necoro' Neumann wrote: >> Subject: Re: shared history but recalling history in current terminal >> >> Am 27.11.2013 09:02, schrieb Bart Schaefer: >>> >>> zle-line-init() { zle set-local-history 1 } >>> zle -N zle-line-init >>> >>> zle-keymap-select() { >>> [[ $KEYMAP = isearch ]] >>> zle set-local-history $? >>> } >>> zle -N zle-keymap-select >> >> Unfortunately, this seems only to work when not doing a 'RETURN' without >> command in a session > > Hmm. The behavior you are describing would seem to imply either that > you've omitted the "1" argument to set-local-history, or that it is > being ignored and set-local-history is simply toggling the state each > time it is called. > > And indeed GDB confirms that passing the argument does not have the > expected effect. > > Workaround is: > > zle-line-init() { NUMERIC=1 zle set-local-history } > zle-keymap-select() { > [[ $KEYMAP = isearch ]] > NUMERIC=$? zle set-local-history > } > > The documentation says "set it with the numeric argument" so I'm not sure > if this is just Wayne's misunderstanding or if zle_hist.c needs a patch. > Hmm. Thanks. This works now in that there is no interleaving. But interleaving is not switched on when entering incremental search. For fun I put the following in: zle-isearch-update() { zle -M "$KEYMAP"; } zle -N zle-isearch-update And this always prints 'main'. Is this a bug? (I'm running 5.0.2 here) - René