From: Mark Walters Date: Fri, 11 Oct 2013 13:39:53 +0000 (+0100) Subject: [PATCH 0/1] emacs: don't show duplicate keys in help. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4d944631dbb4e2a7434a2b28492d7b308cc090f9;p=notmuch-archives.git [PATCH 0/1] emacs: don't show duplicate keys in help. --- diff --git a/32/fa05e0e7eefe6d1a192cc2b8aca0d38472dd0e b/32/fa05e0e7eefe6d1a192cc2b8aca0d38472dd0e new file mode 100644 index 000000000..eb5c36a41 --- /dev/null +++ b/32/fa05e0e7eefe6d1a192cc2b8aca0d38472dd0e @@ -0,0 +1,119 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 9192D431FB6 + for ; Fri, 11 Oct 2013 06:40:07 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +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 hlxEI1BzFSrf for ; + Fri, 11 Oct 2013 06:40:02 -0700 (PDT) +Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com + [74.125.82.52]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + DE450431FAE for ; Fri, 11 Oct 2013 06:40:01 -0700 + (PDT) +Received: by mail-wg0-f52.google.com with SMTP id m15so4249754wgh.19 + for ; Fri, 11 Oct 2013 06:39:59 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id; + bh=PpobWoEVDpgygEquqhqB/U17yvcRxa4jYA6eNVTwUPY=; + b=d0CURVMa+11u9PGx+8GWUXKZGzD50zA92jdkSbY/QkWocdswR1pS49gT7/JXb7UWzH + LpEIYNJahtYD4dhXmfPoIOlV49JKHdd/RSc6bVmq6JWYm+5jyGzOVL1R9a8YDUX9sADy + KD1gLanBUrIz8VLCQDsZZZEkS2keAMfS405fiRTU8nAGdskvZXeuVsltfRUoJwOuVDhz + nXqo0O/shF2/egFs6wZ0/KQvj4Snl2smB3U0BuYODWhuJHXuiYGzq2MDXBZ0J9aCsYDi + e8d6NYgQd1oJoEYEh6BPeqGvnZs0cpWdDCxlIR9orGAZmYS/qKdyHp6SGsD+0oEG8Qak + JnWw== +X-Received: by 10.180.20.77 with SMTP id l13mr3322646wie.40.1381498797939; + Fri, 11 Oct 2013 06:39:57 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id d11sm5837466wic.4.2013.10.11.06.39.56 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Fri, 11 Oct 2013 06:39:57 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH 0/1] emacs: don't show duplicate keys in help. +Date: Fri, 11 Oct 2013 14:39:53 +0100 +Message-Id: <1381498794-17000-1-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +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, 11 Oct 2013 13:40:07 -0000 + +Previously notmuch-help would show two entries for keys in a parent +keymap that were over-ridden in the local keymap. This keeps track of +which keys have been seen and thus avoids these spurious duplicate +entries. + +Currently only pick does this but I think we might easily have the +problem elsewhere in the future. + +Since most of the diff is indentation I include a word-diff below +(which is why there is a cover letter and single patch). + + +Best wishes + +Mark + + + +Mark Walters (1): + emacs: don't show duplicate keys in help. + + emacs/notmuch.el | 45 ++++++++++++++++++++++++--------------------- + 1 files changed, 24 insertions(+), 21 deletions(-) + +word-diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index c47c6b5..4f4e2e7 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -150,8 +150,11 @@ for an overview of how this documentation is extracted. + UA-KEYS should be a key sequence bound to `universal-argument'. + It will be used to describe bindings of commands that support a + prefix argument. PREFIX and TAIL are used internally." ++ (let (keys-seen) + (map-keymap + (lambda (key binding) ++ (unless (memq key keys-seen) ++ (push key keys-seen) + (cond ((mouse-event-p key) nil) + ((keymapp binding) + (setq tail +@@ -169,8 +172,8 @@ prefix argument. PREFIX and TAIL are used internally." + (push (concat prefix (format-kbd-macro (vector key)) "\t" + (or (and (symbolp binding) (get binding 'notmuch-doc)) + (notmuch-documentation-first-line binding))) +- tail)))) +- keymap) ++ tail))))) ++ keymap)) + tail) + + (defun notmuch-substitute-command-keys (doc) + + + + +-- +1.7.9.1 +