From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id AFA65431FBF for ; Thu, 11 Feb 2010 19:04:38 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.997 X-Spam-Level: X-Spam-Status: No, score=-1.997 tagged_above=-999 required=5 tests=[AWL=0.602, BAYES_00=-2.599] autolearn=ham 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 Ib3Y5ECGkaRW for ; Thu, 11 Feb 2010 19:04:38 -0800 (PST) Received: from pivot.cs.unb.ca (pivot.cs.unb.ca [131.202.240.57]) by olra.theworths.org (Postfix) with ESMTP id 255FC431FAE for ; Thu, 11 Feb 2010 19:04:38 -0800 (PST) Received: from fctnnbsc30w-142167166109.pppoe-dynamic.high-speed.nb.bellaliant.net ([142.167.166.109] 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 1Nflpd-0002Mk-SQ; Thu, 11 Feb 2010 23:04:37 -0400 Received: from bremner by rocinante.cs.unb.ca with local (Exim 4.71) (envelope-from ) id 1Nflmw-0008Ga-Vn; Thu, 11 Feb 2010 23:01:51 -0400 From: david@tethera.net To: notmuch@notmuchmail.org Date: Thu, 11 Feb 2010 23:01:07 -0400 Message-Id: <1265943668-31531-2-git-send-email-david@tethera.net> X-Mailer: git-send-email 1.6.5 In-Reply-To: <1265943668-31531-1-git-send-email-david@tethera.net> References: <1261770829-23376-1-git-send-email-david@tethera.net> <1265943668-31531-1-git-send-email-david@tethera.net> X-Sender-Verified: bremner@pivot.cs.unb.ca Cc: David Bremner Subject: [PATCH 1/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.13 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: Fri, 12 Feb 2010 03:04:38 -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 d2a3b1b..60ef592 100644 --- a/notmuch.el +++ b/notmuch.el @@ -984,8 +984,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