Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 113F8431FBD for ; Sat, 26 Dec 2009 19:53:29 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z7-a9XWAhCzB for ; Sat, 26 Dec 2009 19:53:28 -0800 (PST) Received: from pivot.cs.unb.ca (pivot.cs.unb.ca [131.202.240.57]) by olra.theworths.org (Postfix) with ESMTP id 42CAE431FD2 for ; Sat, 26 Dec 2009 19:53:24 -0800 (PST) Received: from fctnnbsc30w-142167182194.pppoe-dynamic.high-speed.nb.bellaliant.net ([142.167.182.194] helo=rocinante.cs.unb.ca) by pivot.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NOkC3-0001fO-Uj; Sat, 26 Dec 2009 23:53:23 -0400 Received: from bremner by rocinante.cs.unb.ca with local (Exim 4.71) (envelope-from ) id 1NOkAJ-0002md-TM; Sat, 26 Dec 2009 23:51:35 -0400 From: david@tethera.net To: notmuch@notmuchmail.org Date: Sat, 26 Dec 2009 23:51:17 -0400 Message-Id: <1261885877-10500-3-git-send-email-david@tethera.net> X-Mailer: git-send-email 1.6.5 In-Reply-To: <1261885877-10500-2-git-send-email-david@tethera.net> References: <1261770829-23376-1-git-send-email-david@tethera.net> <1261885877-10500-1-git-send-email-david@tethera.net> <1261885877-10500-2-git-send-email-david@tethera.net> X-Sender-Verified: bremner@pivot.cs.unb.ca Cc: David Bremner Subject: [notmuch] [PATCH 2/2] notmuch.el: convert sparse keymap to a list in notmuch-substitute-one-command-key-with-prefix X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 03:53:29 -0000 From: David Bremner 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