zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <Peter.Stephenson@csr.com>
To: "Zsh Hackers' List" <zsh-workers@zsh.org>
Subject: Re: PATCH: documentation on keymap selection
Date: Tue, 7 Sep 2010 18:55:39 +0100	[thread overview]
Message-ID: <20100907185539.770b47aa@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <100907095848.ZM12813@torch.brasslantern.com>

On Tue, 07 Sep 2010 09:58:48 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> schaefer<501> bindkey -lL
> bindkey -N .safe
> bindkey -N command
> bindkey -N emacs
> bindkey -N isearch
> bindkey -N listscroll
> bindkey -A emacs main
> bindkey -N menuselect
> bindkey -N vicmd
> bindkey -N viins
> 
> Is it really correct to include "bindkey -N .safe" in that output?

Hmm, that's definitely a good point.

If we simply omit it the output is no longer printing all the keymaps, as
it used to.  Of course, bindkey -l does that, and you can argue bindkey -lL
needs to be useful, which is after all the aim of the previous change.
Given the new behaviour is incompatible with the old, and the old was a
lie, maybe that is the right thing to do.

Index: Doc/Zsh/zle.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/zle.yo,v
retrieving revision 1.87
diff -p -u -r1.87 zle.yo
--- Doc/Zsh/zle.yo	6 Sep 2010 08:50:05 -0000	1.87
+++ Doc/Zsh/zle.yo	7 Sep 2010 17:54:10 -0000
@@ -185,7 +185,10 @@ those keymaps.
 If the tt(-L) option is also used, list in the form of tt(bindkey)
 commands to create or link the keymaps.  `tt(bindkey -lL
 main)' shows which keymap is linked to `tt(main)', if any, and hence if
-the standard emacs or vi emulation is in effect.
+the standard emacs or vi emulation is in effect.  This option does
+not show the tt(.safe) keymap because it cannot be created in that
+fashion; however, neither is `tt(bindkey -lL .safe)' reported as an
+error, it simply outputs nothing.
 )
 item(tt(-d))(
 Delete all existing keymaps and reset to the default state.
Index: Src/Zle/zle_keymap.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_keymap.c,v
retrieving revision 1.34
diff -p -u -r1.34 zle_keymap.c
--- Src/Zle/zle_keymap.c	5 Sep 2010 20:39:09 -0000	1.34
+++ Src/Zle/zle_keymap.c	7 Sep 2010 17:54:10 -0000
@@ -829,12 +829,18 @@ bin_bindkey_lsmaps(char *name, UNUSED(ch
 
 /**/
 static void
-scanlistmaps(HashNode hn, int list)
+scanlistmaps(HashNode hn, int list_verbose)
 {
     KeymapName n = (KeymapName) hn;
 
-    if (list) {
+    if (list_verbose) {
 	Keymap km = n->keymap;
+	/*
+	 * Don't list ".safe" as a bindkey command; we can't
+	 * actually create it that way.
+	 */
+	if (!strcmp(n->nam, ".safe"))
+	    return;
 	fputs("bindkey -", stdout);
 	if (km->primary && km->primary != n) {
 	    KeymapName pn = km->primary;

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


  parent reply	other threads:[~2010-09-07 17:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-03 22:06 Peter Stephenson
2010-09-05 19:40 ` Peter Stephenson
2010-09-05 22:44   ` Bart Schaefer
2010-09-07 16:58   ` Bart Schaefer
2010-09-07 17:16     ` Bart Schaefer
2010-09-07 17:55     ` Peter Stephenson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-09-03 20:47 Peter Stephenson

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=20100907185539.770b47aa@pwslap01u.europe.root.pri \
    --to=peter.stephenson@csr.com \
    --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).