zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: give precedence to local keymaps (was Re: More on getkeycmd())
Date: Mon, 03 Nov 2014 09:45:30 +0100	[thread overview]
Message-ID: <18653.1415004330@thecus.kiddle.eu> (raw)
In-Reply-To: <1050927145304.ZM23258@candle.brasslantern.com>

I'd like to back out the change in 21770:

At the time, on 27 Sep 2005, Bart wrote:
> It occurred to me that the patch I posted in 21760 causes longer bindings
> in the local map to hide prefixes in the global map.  That's probably not
> the desired behavior; the change would be as follows.  Should this get
> committed also?

I find in practice that this hiding is my desired behaviour. The
alternative is shorter bindings in the global map hiding longer ones in
the local map. If you want to preserve the global binding, simply don't
bind longer ones in the local map. The other way around tends to be less
possible because the global map has a wider purpose.

Oliver

diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index 2e54e7f..e21e769 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -1435,10 +1435,9 @@ getkeymapcmd(Keymap km, Thingy *funcp, char **strp)
 	    loc = ((f = keybind(localkeymap, keybuf, &s)) != t_undefinedkey);
 	    ispfx = keyisprefix(localkeymap, keybuf);
 	}
-	if (!loc && !ispfx) {
+	if (!loc)
 	    f = keybind(km, keybuf, &s);
-	    ispfx = keyisprefix(km, keybuf);
-	}
+	ispfx |= keyisprefix(km, keybuf);
 
 	if (f != t_undefinedkey) {
 	    lastlen = keybuflen;


  parent reply	other threads:[~2014-11-03  8:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-27 14:53 More on getkeycmd() Bart Schaefer
2005-09-27 15:01 ` Peter Stephenson
2005-09-27 15:43   ` Bart Schaefer
2014-11-03  8:45 ` Oliver Kiddle [this message]
2014-11-03  9:33   ` PATCH: give precedence to local keymaps (was Re: More on getkeycmd()) Bart Schaefer
2014-11-03 16:30     ` Oliver Kiddle
2014-11-04  3:58       ` 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=18653.1415004330@thecus.kiddle.eu \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@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).