From bf4b8e9229017ebc37a16f414b862964851b7d58 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Fri, 8 Nov 2013 17:40:16 +0000 Subject: [PATCH] [PATCH v3 4/7] emacs: help: add base-keymap --- d1/cb0177386fe0b867be354518b194fb3241cbdb | 104 ++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 d1/cb0177386fe0b867be354518b194fb3241cbdb diff --git a/d1/cb0177386fe0b867be354518b194fb3241cbdb b/d1/cb0177386fe0b867be354518b194fb3241cbdb new file mode 100644 index 000000000..488df99f1 --- /dev/null +++ b/d1/cb0177386fe0b867be354518b194fb3241cbdb @@ -0,0 +1,104 @@ +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 9D244429E39 + for ; Fri, 8 Nov 2013 09:40:45 -0800 (PST) +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 F4N77WYZBefB for ; + Fri, 8 Nov 2013 09:40:40 -0800 (PST) +Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com + [209.85.212.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 82964429E26 + for ; Fri, 8 Nov 2013 09:40:30 -0800 (PST) +Received: by mail-wi0-f171.google.com with SMTP id hn9so707778wib.16 + for ; Fri, 08 Nov 2013 09:40:29 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=I3pSsapdErPHsuia9nam+vrk2WYgmXiJ2CeMVTdHNew=; + b=B9U6d2zUmD2p66SIxRfLh9IAqwTMAYAg6vns9L9oXgvHe3GQgJ2kex/P8AP4+LoDea + UyaeSBw5kZynabadAwbpY2on/+8XV1+8GylvxL43qrj85aOLZrSiZPoJbiY5AotH1PrM + 3iCHHroo6jqvXwniXzGb7UHD+HkVL5NGcwLOfR7h3bk9dn525ZTxEx2tBAj+cnniQhsL + 8/0HLgxCGkNcFzs8atFEVlAo//rvbAd85090go7y+xrTC+qXwkfi8GmImyUJaCE2C+X0 + OlmsdrnypLniiFJB4au++/JH0d7yVXR3LwM8lRjOgylNznUID10lGDnb0YEMazzNGVIx + eY1w== +X-Received: by 10.180.198.79 with SMTP id ja15mr3284404wic.36.1383932429505; + Fri, 08 Nov 2013 09:40:29 -0800 (PST) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id ey4sm7504302wic.11.2013.11.08.09.40.28 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Fri, 08 Nov 2013 09:40:29 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v3 4/7] emacs: help: add base-keymap +Date: Fri, 8 Nov 2013 17:40:16 +0000 +Message-Id: <1383932419-12533-5-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1383932419-12533-1-git-send-email-markwalters1009@gmail.com> +References: <1383932419-12533-1-git-send-email-markwalters1009@gmail.com> +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, 08 Nov 2013 17:40:46 -0000 + +To support key remapping in emacs help we need to know the base keymap +when looking at the remapping. keep track of this while we recurse +down the sub-keymaps in help. +--- + emacs/notmuch-lib.el | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el +index 8852703..a4f481b 100644 +--- a/emacs/notmuch-lib.el ++++ b/emacs/notmuch-lib.el +@@ -261,7 +261,7 @@ It does not prepend if ACTUAL-KEY is already listed in TAIL." + tail))) + tail) + +-(defun notmuch-describe-keymap (keymap ua-keys &optional prefix tail) ++(defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail) + "Return a list of cons cells, each describing one binding in KEYMAP. + + Each cons cell consists of a string giving a human-readable +@@ -278,7 +278,7 @@ prefix argument. PREFIX and TAIL are used internally." + ((keymapp binding) + (setq tail + (notmuch-describe-keymap +- binding ua-keys (notmuch-prefix-key-description key) tail))) ++ binding ua-keys base-keymap (notmuch-prefix-key-description key) tail))) + (binding + (setq tail (notmuch-describe-key (vector key) binding prefix ua-keys tail))))) + keymap) +@@ -291,7 +291,7 @@ prefix argument. PREFIX and TAIL are used internally." + (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1))) + (keymap (symbol-value (intern keymap-name))) + (ua-keys (where-is-internal 'universal-argument keymap t)) +- (desc-alist (notmuch-describe-keymap keymap ua-keys)) ++ (desc-alist (notmuch-describe-keymap keymap ua-keys keymap)) + (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist)) + (desc (mapconcat #'identity desc-list "\n"))) + (setq doc (replace-match desc 1 1 doc))) +-- +1.7.9.1 + -- 2.26.2