unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: david@tethera.net
To: notmuch@notmuchmail.org
Cc: David Bremner <bremner@unb.ca>
Subject: [PATCH 2/2] notmuch.el: convert sparse keymap to a list in notmuch-substitute-one-command-key-with-prefix
Date: Sat, 26 Dec 2009 23:51:17 -0400	[thread overview]
Message-ID: <1261885877-10500-3-git-send-email-david@tethera.net> (raw)
In-Reply-To: <1261885877-10500-2-git-send-email-david@tethera.net>

From: David Bremner <bremner@unb.ca>

The previous version would crash when a key was bound to a sparse
keymap, since apparently these are not straightforward lists.  The
usage of map-keymap is a bit obscure: it only has side-effects, no
return value.
---
 notmuch.el |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 8df0778..7b058de 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -846,8 +846,12 @@ For a mouse binding, return nil."
     (if (mouse-event-p key)
 	nil
       (if (keymapp action)
-	  (let ((substitute (apply-partially 'notmuch-substitute-one-command-key-with-prefix (notmuch-prefix-key-description key))))
-	    (mapconcat substitute (cdr action) "\n"))
+	  (let ((substitute (apply-partially 'notmuch-substitute-one-command-key-with-prefix (notmuch-prefix-key-description key)))
+		(as-list))
+	    (map-keymap (lambda (a b)
+			  (push (cons a b) as-list))
+			action)
+	    (mapconcat substitute as-list "\n"))
 	(concat prefix (format-kbd-macro (vector key))
 		"\t"
 		(notmuch-documentation-first-line action))))))
-- 
1.6.5

  reply	other threads:[~2009-12-27  3:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-25 19:53 [PATCH] notmuch.el: add a submap (on "z" for "ztash") to stash things david
2009-12-27  3:51 ` (no subject) david
2009-12-27  3:51   ` [PATCH 1/2] notmuch.el: add a submap (on "z" for "ztash") to stash things david
2009-12-27  3:51     ` david [this message]
2010-02-12  3:01 ` Rebased and updated stash patches david
2010-02-12  3:01   ` [PATCH 1/2] notmuch.el: convert sparse keymap to a list in notmuch-substitute-one-command-key-with-prefix david
2010-02-12  3:01     ` [PATCH 2/2] notmuch.el: add a submap (on "z" for "ztash") to stash things david
2010-02-12  3:56       ` Jameson Rollins
2010-02-12 15:50       ` Michal Sojka
2010-02-20 20:31       ` Carl Worth

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

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1261885877-10500-3-git-send-email-david@tethera.net \
    --to=david@tethera.net \
    --cc=bremner@unb.ca \
    --cc=notmuch@notmuchmail.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://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).