[PATCH 1/1] emacs: don't show duplicate keys in help.
authorMark Walters <markwalters1009@gmail.com>
Fri, 11 Oct 2013 13:39:54 +0000 (14:39 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:57:23 +0000 (09:57 -0800)
34/df63795f2b3bab1a17626bd5541ac58d753cfd [new file with mode: 0644]

diff --git a/34/df63795f2b3bab1a17626bd5541ac58d753cfd b/34/df63795f2b3bab1a17626bd5541ac58d753cfd
new file mode 100644 (file)
index 0000000..557d40a
--- /dev/null
@@ -0,0 +1,130 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 307DA431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 11 Oct 2013 06:40:08 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 6tMpiLV-KfPk for <notmuch@notmuchmail.org>;\r
+       Fri, 11 Oct 2013 06:40:02 -0700 (PDT)\r
+Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com\r
+ [74.125.82.51])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 8502B431FAF   for <notmuch@notmuchmail.org>; Fri, 11 Oct 2013 06:40:02 -0700\r
+ (PDT)\r
+Received: by mail-wg0-f51.google.com with SMTP id l18so443822wgh.30\r
+       for <notmuch@notmuchmail.org>; Fri, 11 Oct 2013 06:40:00 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+       bh=IVwzimEJLqmJCzEd5go0ZUoy5BK9BMGw5j1TJOlx+Vs=;\r
+       b=Q0QSfoCK3nc13lOd1Wm9p7eovHRL6z+2w0oheyaKl69if7g1mKXidGzrF9+O+LHxUf\r
+       t2jZ6jTIUEh5QKAUcZOSoNdWfMKv3+wruwKFbrayEkGHQyKqjlrzIw0kcN5WKcLp+lF1\r
+       XNSEAWBfhau9/UCw66PkdSrmpnu8OZwGeVJGpku5VPRVQHSJPv0FnnOYznpx9s/afoIY\r
+       dBBpWpoVxkCceWLdaMNUJ6bExz3Ku9RBEF4AcOn9p91FP5wdyCUd4VQLuTf2fon0WrNy\r
+       4CyQOqKzdl3qFV+w8gmdLm+sSvkf49nBM/XU86Z6vdFiw/Bst8gSV56rIFRIwQwRQuOR\r
+       65yQ==\r
+X-Received: by 10.194.104.42 with SMTP id gb10mr17351416wjb.16.1381498799996; \r
+       Fri, 11 Oct 2013 06:39:59 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPSA id b7sm5823085wiz.8.1969.12.31.16.00.00\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Fri, 11 Oct 2013 06:39:59 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/1] emacs: don't show duplicate keys in help.\r
+Date: Fri, 11 Oct 2013 14:39:54 +0100\r
+Message-Id: <1381498794-17000-2-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1381498794-17000-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1381498794-17000-1-git-send-email-markwalters1009@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 11 Oct 2013 13:40:08 -0000\r
+\r
+Previously notmuch-help would show two entries for keys in a parent\r
+keymap that were over-ridden in the local keymap.  This keeps track of\r
+which keys have been seen and thus avoids these spurious duplicate\r
+entries.\r
+\r
+---\r
+ emacs/notmuch.el |   45 ++++++++++++++++++++++++---------------------\r
+ 1 files changed, 24 insertions(+), 21 deletions(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index c47c6b5..4f4e2e7 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -150,27 +150,30 @@ for an overview of how this documentation is extracted.\r
+ UA-KEYS should be a key sequence bound to `universal-argument'.\r
+ It will be used to describe bindings of commands that support a\r
+ prefix argument.  PREFIX and TAIL are used internally."\r
+-  (map-keymap\r
+-   (lambda (key binding)\r
+-     (cond ((mouse-event-p key) nil)\r
+-         ((keymapp binding)\r
+-          (setq tail\r
+-                (notmuch-describe-keymap\r
+-                 binding ua-keys (notmuch-prefix-key-description key) tail)))\r
+-         (t\r
+-          (when (and ua-keys (symbolp binding)\r
+-                     (get binding 'notmuch-prefix-doc))\r
+-            ;; Documentation for prefixed command\r
+-            (let ((ua-desc (key-description ua-keys)))\r
+-              (push (concat ua-desc " " prefix (format-kbd-macro (vector key))\r
+-                            "\t" (get binding 'notmuch-prefix-doc))\r
+-                    tail)))\r
+-          ;; Documentation for command\r
+-          (push (concat prefix (format-kbd-macro (vector key)) "\t"\r
+-                        (or (and (symbolp binding) (get binding 'notmuch-doc))\r
+-                            (notmuch-documentation-first-line binding)))\r
+-                tail))))\r
+-   keymap)\r
++  (let (keys-seen)\r
++    (map-keymap\r
++     (lambda (key binding)\r
++       (unless (memq key keys-seen)\r
++       (push key keys-seen)\r
++       (cond ((mouse-event-p key) nil)\r
++             ((keymapp binding)\r
++              (setq tail\r
++                    (notmuch-describe-keymap\r
++                     binding ua-keys (notmuch-prefix-key-description key) tail)))\r
++             (t\r
++              (when (and ua-keys (symbolp binding)\r
++                         (get binding 'notmuch-prefix-doc))\r
++                ;; Documentation for prefixed command\r
++                (let ((ua-desc (key-description ua-keys)))\r
++                  (push (concat ua-desc " " prefix (format-kbd-macro (vector key))\r
++                                "\t" (get binding 'notmuch-prefix-doc))\r
++                        tail)))\r
++              ;; Documentation for command\r
++              (push (concat prefix (format-kbd-macro (vector key)) "\t"\r
++                            (or (and (symbolp binding) (get binding 'notmuch-doc))\r
++                                (notmuch-documentation-first-line binding)))\r
++                    tail)))))\r
++     keymap))\r
+   tail)\r
\r
+ (defun notmuch-substitute-command-keys (doc)\r
+-- \r
+1.7.9.1\r
+\r