[PATCH v4 5/7] emacs: help: add base-keymap
authorMark Walters <markwalters1009@gmail.com>
Tue, 12 Nov 2013 20:10:57 +0000 (20:10 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:58:13 +0000 (09:58 -0800)
78/c8b7eab0ae07fd965dc05f89b7da828d69f403 [new file with mode: 0644]

diff --git a/78/c8b7eab0ae07fd965dc05f89b7da828d69f403 b/78/c8b7eab0ae07fd965dc05f89b7da828d69f403
new file mode 100644 (file)
index 0000000..6d3e0aa
--- /dev/null
@@ -0,0 +1,104 @@
+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 23ADD431FDD\r
+       for <notmuch@notmuchmail.org>; Tue, 12 Nov 2013 12:18:23 -0800 (PST)\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 arbVt+AX0V8a for <notmuch@notmuchmail.org>;\r
+       Tue, 12 Nov 2013 12:18:16 -0800 (PST)\r
+Received: from mail-we0-f170.google.com (mail-we0-f170.google.com\r
+       [74.125.82.170]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 4D18B431FDC\r
+       for <notmuch@notmuchmail.org>; Tue, 12 Nov 2013 12:18:16 -0800 (PST)\r
+Received: by mail-we0-f170.google.com with SMTP id p61so567211wes.1\r
+       for <notmuch@notmuchmail.org>; Tue, 12 Nov 2013 12:18:15 -0800 (PST)\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=JBnMmkN3KUeENL0ZBaLCUIDQ0DGyk2erVCWDh8Sli+8=;\r
+       b=Gy5PQzyxpzb0WlFf7aW+mCt938JXpReLK2vFL8bGV4hUXLZyM8iuw2MQ1FWvSoahXx\r
+       c69qOO1ANFkKfk1nXa/GZfDbzE5YdVMJM10TqsxU41anJTytWgWypCUVhyPalILvZJ34\r
+       IO/D21VtD25xWLDSiidBtkYVbUhZMcPKpGJ0Bt58gpr0V22sGz7PTpQ54lkRcfKdCXG4\r
+       FvE9Pb4ZugRhmt5UXSeP+lWZjknMbHiRWNzGb8N5nxr01eDWFmh8un0oFhPhxvUqJT34\r
+       Jf9RILQScBdJrKMwdYPw0ef6QqCeoYSXJ915rPzX2Y+Zzg3ij5huGHH61QHNf2birwU/\r
+       t0zg==\r
+X-Received: by 10.180.221.38 with SMTP id qb6mr17564618wic.8.1384287073156;\r
+       Tue, 12 Nov 2013 12:11:13 -0800 (PST)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPSA id\r
+       ey4sm48137633wic.11.2013.11.12.12.11.12 for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Tue, 12 Nov 2013 12:11:12 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v4 5/7] emacs: help: add base-keymap\r
+Date: Tue, 12 Nov 2013 20:10:57 +0000\r
+Message-Id: <1384287059-3525-6-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1384287059-3525-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1384287059-3525-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: Tue, 12 Nov 2013 20:18:23 -0000\r
+\r
+To support key remapping in emacs help we need to know the base keymap\r
+when looking at the remapping. keep track of this while we recurse\r
+down the sub-keymaps in help.\r
+---\r
+ emacs/notmuch-lib.el |    6 +++---\r
+ 1 files changed, 3 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+index 33790e2..7b1fc33 100644\r
+--- a/emacs/notmuch-lib.el\r
++++ b/emacs/notmuch-lib.el\r
+@@ -261,7 +261,7 @@ It does not prepend if ACTUAL-KEY is already listed in TAIL."\r
+           tail)))\r
+     tail)\r
\r
+-(defun notmuch-describe-keymap (keymap ua-keys &optional prefix tail)\r
++(defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail)\r
+   "Return a list of cons cells, each describing one binding in KEYMAP.\r
\r
+ Each cons cell consists of a string giving a human-readable\r
+@@ -278,7 +278,7 @@ prefix argument.  PREFIX and TAIL are used internally."\r
+          ((keymapp binding)\r
+           (setq tail\r
+                 (notmuch-describe-keymap\r
+-                 binding ua-keys (notmuch-prefix-key-description key) tail)))\r
++                 binding ua-keys base-keymap (notmuch-prefix-key-description key) tail)))\r
+          (binding\r
+           (setq tail (notmuch-describe-key (vector key) binding prefix ua-keys tail)))))\r
+    keymap)\r
+@@ -293,7 +293,7 @@ prefix argument.  PREFIX and TAIL are used internally."\r
+              (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))\r
+                     (keymap (symbol-value (intern keymap-name)))\r
+                     (ua-keys (where-is-internal 'universal-argument keymap t))\r
+-                    (desc-alist (notmuch-describe-keymap keymap ua-keys))\r
++                    (desc-alist (notmuch-describe-keymap keymap ua-keys keymap))\r
+                     (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist)))\r
+                (mapconcat #'identity desc-list "\n")))))\r
+       (setq doc (replace-match desc 1 1 doc)))\r
+-- \r
+1.7.9.1\r
+\r