zsh-users
 help / color / mirror / code / Atom feed
From: "René 'Necoro' Neumann" <lists@necoro.eu>
To: zsh-users@zsh.org
Subject: Re: shared history but recalling history in current terminal
Date: Thu, 28 Nov 2013 21:44:39 +0100	[thread overview]
Message-ID: <5297AB37.80504@necoro.eu> (raw)
In-Reply-To: <131127170553.ZM23821@torch.brasslantern.com>

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é


  reply	other threads:[~2013-11-28 20:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26 20:30 shawn wilson
2013-11-27  6:31 ` Wayne Davison
2013-11-27  8:02   ` Bart Schaefer
2013-11-27 13:49     ` shawn wilson
2013-11-27 15:11       ` Karoly Negyesi
2013-11-27 15:17         ` shawn wilson
2013-11-27 18:24         ` Bart Schaefer
2013-11-27 19:08     ` René 'Necoro' Neumann
2013-11-28  1:05       ` Bart Schaefer
2013-11-28 20:44         ` René 'Necoro' Neumann [this message]
2013-11-28 21:33           ` Bart Schaefer
2013-11-30 11:03             ` René 'Necoro' Neumann
2013-11-30 19:07               ` Bart Schaefer
2013-12-08 23:40             ` Jan Larres
2013-12-08 23:54               ` Jan Larres
2013-12-10  7:09                 ` Bart Schaefer

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=5297AB37.80504@necoro.eu \
    --to=lists@necoro.eu \
    --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).