Re: Hi all
[notmuch-archives.git] / 29 / 3d4bffe7fe505881bc0a8a24969a0715549330
1 Return-Path: <bremner@pivot.cs.unb.ca>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id AFA65431FBF\r
6         for <notmuch@notmuchmail.org>; Thu, 11 Feb 2010 19:04:38 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.997\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.997 tagged_above=-999 required=5 tests=[AWL=0.602,\r
12         BAYES_00=-2.599] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id Ib3Y5ECGkaRW for <notmuch@notmuchmail.org>;\r
16         Thu, 11 Feb 2010 19:04:38 -0800 (PST)\r
17 Received: from pivot.cs.unb.ca (pivot.cs.unb.ca [131.202.240.57])\r
18         by olra.theworths.org (Postfix) with ESMTP id 255FC431FAE\r
19         for <notmuch@notmuchmail.org>; Thu, 11 Feb 2010 19:04:38 -0800 (PST)\r
20 Received: from\r
21         fctnnbsc30w-142167166109.pppoe-dynamic.high-speed.nb.bellaliant.net\r
22         ([142.167.166.109] helo=rocinante.cs.unb.ca)\r
23         by pivot.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)\r
24         (Exim 4.69) (envelope-from <bremner@pivot.cs.unb.ca>)\r
25         id 1Nflpd-0002Mk-SQ; Thu, 11 Feb 2010 23:04:37 -0400\r
26 Received: from bremner by rocinante.cs.unb.ca with local (Exim 4.71)\r
27         (envelope-from <bremner@rocinante.cs.unb.ca>)\r
28         id 1Nflmw-0008Ga-Vn; Thu, 11 Feb 2010 23:01:51 -0400\r
29 From: david@tethera.net\r
30 To: notmuch@notmuchmail.org\r
31 Date: Thu, 11 Feb 2010 23:01:07 -0400\r
32 Message-Id: <1265943668-31531-2-git-send-email-david@tethera.net>\r
33 X-Mailer: git-send-email 1.6.5\r
34 In-Reply-To: <1265943668-31531-1-git-send-email-david@tethera.net>\r
35 References: <1261770829-23376-1-git-send-email-david@tethera.net>\r
36         <1265943668-31531-1-git-send-email-david@tethera.net>\r
37 X-Sender-Verified: bremner@pivot.cs.unb.ca\r
38 Cc: David Bremner <bremner@unb.ca>\r
39 Subject: [notmuch] [PATCH 1/2] notmuch.el: convert sparse keymap to a list\r
40         in notmuch-substitute-one-command-key-with-prefix\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Fri, 12 Feb 2010 03:04:38 -0000\r
54 \r
55 From: David Bremner <bremner@unb.ca>\r
56 \r
57 The previous version would crash when a key was bound to a sparse\r
58 keymap, since apparently these are not straightforward lists.  The\r
59 usage of map-keymap is a bit obscure: it only has side-effects, no\r
60 return value.\r
61 ---\r
62  notmuch.el |    8 ++++++--\r
63  1 files changed, 6 insertions(+), 2 deletions(-)\r
64 \r
65 diff --git a/notmuch.el b/notmuch.el\r
66 index d2a3b1b..60ef592 100644\r
67 --- a/notmuch.el\r
68 +++ b/notmuch.el\r
69 @@ -984,8 +984,12 @@ For a mouse binding, return nil."\r
70      (if (mouse-event-p key)\r
71         nil\r
72        (if (keymapp action)\r
73 -         (let ((substitute (apply-partially 'notmuch-substitute-one-command-key-with-prefix (notmuch-prefix-key-description key))))\r
74 -           (mapconcat substitute (cdr action) "\n"))\r
75 +         (let ((substitute (apply-partially 'notmuch-substitute-one-command-key-with-prefix (notmuch-prefix-key-description key)))\r
76 +               (as-list))\r
77 +           (map-keymap (lambda (a b)\r
78 +                         (push (cons a b) as-list))\r
79 +                       action)\r
80 +           (mapconcat substitute as-list "\n"))\r
81         (concat prefix (format-kbd-macro (vector key))\r
82                 "\t"\r
83                 (notmuch-documentation-first-line action))))))\r
84 -- \r
85 1.6.5\r
86 \r