[PATCH v4 5/7] Introduce _notmuch_message_has_term()
[notmuch-archives.git] / 16 / 1df6ed9e8e31b2e10f23153465a5e86c3d8beb
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 113F8431FBD\r
6         for <notmuch@notmuchmail.org>; Sat, 26 Dec 2009 19:53:29 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id Z7-a9XWAhCzB for <notmuch@notmuchmail.org>;\r
11         Sat, 26 Dec 2009 19:53:28 -0800 (PST)\r
12 Received: from pivot.cs.unb.ca (pivot.cs.unb.ca [131.202.240.57])\r
13         by olra.theworths.org (Postfix) with ESMTP id 42CAE431FD2\r
14         for <notmuch@notmuchmail.org>; Sat, 26 Dec 2009 19:53:24 -0800 (PST)\r
15 Received: from\r
16         fctnnbsc30w-142167182194.pppoe-dynamic.high-speed.nb.bellaliant.net\r
17         ([142.167.182.194] helo=rocinante.cs.unb.ca)\r
18         by pivot.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)\r
19         (Exim 4.69) (envelope-from <bremner@pivot.cs.unb.ca>)\r
20         id 1NOkC3-0001fO-Uj; Sat, 26 Dec 2009 23:53:23 -0400\r
21 Received: from bremner by rocinante.cs.unb.ca with local (Exim 4.71)\r
22         (envelope-from <bremner@rocinante.cs.unb.ca>)\r
23         id 1NOkAJ-0002md-TM; Sat, 26 Dec 2009 23:51:35 -0400\r
24 From: david@tethera.net\r
25 To: notmuch@notmuchmail.org\r
26 Date: Sat, 26 Dec 2009 23:51:17 -0400\r
27 Message-Id: <1261885877-10500-3-git-send-email-david@tethera.net>\r
28 X-Mailer: git-send-email 1.6.5\r
29 In-Reply-To: <1261885877-10500-2-git-send-email-david@tethera.net>\r
30 References: <1261770829-23376-1-git-send-email-david@tethera.net>\r
31         <1261885877-10500-1-git-send-email-david@tethera.net>\r
32         <1261885877-10500-2-git-send-email-david@tethera.net>\r
33 X-Sender-Verified: bremner@pivot.cs.unb.ca\r
34 Cc: David Bremner <bremner@unb.ca>\r
35 Subject: [notmuch] [PATCH 2/2] notmuch.el: convert sparse keymap to a list\r
36         in notmuch-substitute-one-command-key-with-prefix\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.12\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Sun, 27 Dec 2009 03:53:29 -0000\r
50 \r
51 From: David Bremner <bremner@unb.ca>\r
52 \r
53 The previous version would crash when a key was bound to a sparse\r
54 keymap, since apparently these are not straightforward lists.  The\r
55 usage of map-keymap is a bit obscure: it only has side-effects, no\r
56 return value.\r
57 ---\r
58  notmuch.el |    8 ++++++--\r
59  1 files changed, 6 insertions(+), 2 deletions(-)\r
60 \r
61 diff --git a/notmuch.el b/notmuch.el\r
62 index 8df0778..7b058de 100644\r
63 --- a/notmuch.el\r
64 +++ b/notmuch.el\r
65 @@ -846,8 +846,12 @@ For a mouse binding, return nil."\r
66      (if (mouse-event-p key)\r
67         nil\r
68        (if (keymapp action)\r
69 -         (let ((substitute (apply-partially 'notmuch-substitute-one-command-key-with-prefix (notmuch-prefix-key-description key))))\r
70 -           (mapconcat substitute (cdr action) "\n"))\r
71 +         (let ((substitute (apply-partially 'notmuch-substitute-one-command-key-with-prefix (notmuch-prefix-key-description key)))\r
72 +               (as-list))\r
73 +           (map-keymap (lambda (a b)\r
74 +                         (push (cons a b) as-list))\r
75 +                       action)\r
76 +           (mapconcat substitute as-list "\n"))\r
77         (concat prefix (format-kbd-macro (vector key))\r
78                 "\t"\r
79                 (notmuch-documentation-first-line action))))))\r
80 -- \r
81 1.6.5\r
82 \r