Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 34 / df63795f2b3bab1a17626bd5541ac58d753cfd
1 Return-Path: <markwalters1009@gmail.com>\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 307DA431FAE\r
6         for <notmuch@notmuchmail.org>; Fri, 11 Oct 2013 06:40:08 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id 6tMpiLV-KfPk for <notmuch@notmuchmail.org>;\r
18         Fri, 11 Oct 2013 06:40:02 -0700 (PDT)\r
19 Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com\r
20  [74.125.82.51])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
21  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
22  8502B431FAF    for <notmuch@notmuchmail.org>; Fri, 11 Oct 2013 06:40:02 -0700\r
23  (PDT)\r
24 Received: by mail-wg0-f51.google.com with SMTP id l18so443822wgh.30\r
25         for <notmuch@notmuchmail.org>; Fri, 11 Oct 2013 06:40:00 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
28         bh=IVwzimEJLqmJCzEd5go0ZUoy5BK9BMGw5j1TJOlx+Vs=;\r
29         b=Q0QSfoCK3nc13lOd1Wm9p7eovHRL6z+2w0oheyaKl69if7g1mKXidGzrF9+O+LHxUf\r
30         t2jZ6jTIUEh5QKAUcZOSoNdWfMKv3+wruwKFbrayEkGHQyKqjlrzIw0kcN5WKcLp+lF1\r
31         XNSEAWBfhau9/UCw66PkdSrmpnu8OZwGeVJGpku5VPRVQHSJPv0FnnOYznpx9s/afoIY\r
32         dBBpWpoVxkCceWLdaMNUJ6bExz3Ku9RBEF4AcOn9p91FP5wdyCUd4VQLuTf2fon0WrNy\r
33         4CyQOqKzdl3qFV+w8gmdLm+sSvkf49nBM/XU86Z6vdFiw/Bst8gSV56rIFRIwQwRQuOR\r
34         65yQ==\r
35 X-Received: by 10.194.104.42 with SMTP id gb10mr17351416wjb.16.1381498799996; \r
36         Fri, 11 Oct 2013 06:39:59 -0700 (PDT)\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
38         by mx.google.com with ESMTPSA id b7sm5823085wiz.8.1969.12.31.16.00.00\r
39         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
40         Fri, 11 Oct 2013 06:39:59 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH 1/1] emacs: don't show duplicate keys in help.\r
44 Date: Fri, 11 Oct 2013 14:39:54 +0100\r
45 Message-Id: <1381498794-17000-2-git-send-email-markwalters1009@gmail.com>\r
46 X-Mailer: git-send-email 1.7.9.1\r
47 In-Reply-To: <1381498794-17000-1-git-send-email-markwalters1009@gmail.com>\r
48 References: <1381498794-17000-1-git-send-email-markwalters1009@gmail.com>\r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.13\r
51 Precedence: list\r
52 List-Id: "Use and development of the notmuch mail system."\r
53         <notmuch.notmuchmail.org>\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
57 List-Post: <mailto:notmuch@notmuchmail.org>\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
61 X-List-Received-Date: Fri, 11 Oct 2013 13:40:08 -0000\r
62 \r
63 Previously notmuch-help would show two entries for keys in a parent\r
64 keymap that were over-ridden in the local keymap.  This keeps track of\r
65 which keys have been seen and thus avoids these spurious duplicate\r
66 entries.\r
67 \r
68 ---\r
69  emacs/notmuch.el |   45 ++++++++++++++++++++++++---------------------\r
70  1 files changed, 24 insertions(+), 21 deletions(-)\r
71 \r
72 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
73 index c47c6b5..4f4e2e7 100644\r
74 --- a/emacs/notmuch.el\r
75 +++ b/emacs/notmuch.el\r
76 @@ -150,27 +150,30 @@ for an overview of how this documentation is extracted.\r
77  UA-KEYS should be a key sequence bound to `universal-argument'.\r
78  It will be used to describe bindings of commands that support a\r
79  prefix argument.  PREFIX and TAIL are used internally."\r
80 -  (map-keymap\r
81 -   (lambda (key binding)\r
82 -     (cond ((mouse-event-p key) nil)\r
83 -          ((keymapp binding)\r
84 -           (setq tail\r
85 -                 (notmuch-describe-keymap\r
86 -                  binding ua-keys (notmuch-prefix-key-description key) tail)))\r
87 -          (t\r
88 -           (when (and ua-keys (symbolp binding)\r
89 -                      (get binding 'notmuch-prefix-doc))\r
90 -             ;; Documentation for prefixed command\r
91 -             (let ((ua-desc (key-description ua-keys)))\r
92 -               (push (concat ua-desc " " prefix (format-kbd-macro (vector key))\r
93 -                             "\t" (get binding 'notmuch-prefix-doc))\r
94 -                     tail)))\r
95 -           ;; Documentation for command\r
96 -           (push (concat prefix (format-kbd-macro (vector key)) "\t"\r
97 -                         (or (and (symbolp binding) (get binding 'notmuch-doc))\r
98 -                             (notmuch-documentation-first-line binding)))\r
99 -                 tail))))\r
100 -   keymap)\r
101 +  (let (keys-seen)\r
102 +    (map-keymap\r
103 +     (lambda (key binding)\r
104 +       (unless (memq key keys-seen)\r
105 +        (push key keys-seen)\r
106 +        (cond ((mouse-event-p key) nil)\r
107 +              ((keymapp binding)\r
108 +               (setq tail\r
109 +                     (notmuch-describe-keymap\r
110 +                      binding ua-keys (notmuch-prefix-key-description key) tail)))\r
111 +              (t\r
112 +               (when (and ua-keys (symbolp binding)\r
113 +                          (get binding 'notmuch-prefix-doc))\r
114 +                 ;; Documentation for prefixed command\r
115 +                 (let ((ua-desc (key-description ua-keys)))\r
116 +                   (push (concat ua-desc " " prefix (format-kbd-macro (vector key))\r
117 +                                 "\t" (get binding 'notmuch-prefix-doc))\r
118 +                         tail)))\r
119 +               ;; Documentation for command\r
120 +               (push (concat prefix (format-kbd-macro (vector key)) "\t"\r
121 +                             (or (and (symbolp binding) (get binding 'notmuch-doc))\r
122 +                                 (notmuch-documentation-first-line binding)))\r
123 +                     tail)))))\r
124 +     keymap))\r
125    tail)\r
126  \r
127  (defun notmuch-substitute-command-keys (doc)\r
128 -- \r
129 1.7.9.1\r
130 \r