From fe0adb81bc679a946ed203251c101eef295aeff1 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Tue, 12 Nov 2013 20:10:57 +0000 Subject: [PATCH] [PATCH v4 5/7] emacs: help: add base-keymap --- 78/c8b7eab0ae07fd965dc05f89b7da828d69f403 | 104 ++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 78/c8b7eab0ae07fd965dc05f89b7da828d69f403 diff --git a/78/c8b7eab0ae07fd965dc05f89b7da828d69f403 b/78/c8b7eab0ae07fd965dc05f89b7da828d69f403 new file mode 100644 index 000000000..6d3e0aaaa --- /dev/null +++ b/78/c8b7eab0ae07fd965dc05f89b7da828d69f403 @@ -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 23ADD431FDD + for ; Tue, 12 Nov 2013 12:18:23 -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 arbVt+AX0V8a for ; + Tue, 12 Nov 2013 12:18:16 -0800 (PST) +Received: from mail-we0-f170.google.com (mail-we0-f170.google.com + [74.125.82.170]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 4D18B431FDC + for ; Tue, 12 Nov 2013 12:18:16 -0800 (PST) +Received: by mail-we0-f170.google.com with SMTP id p61so567211wes.1 + for ; Tue, 12 Nov 2013 12:18:15 -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=JBnMmkN3KUeENL0ZBaLCUIDQ0DGyk2erVCWDh8Sli+8=; + b=Gy5PQzyxpzb0WlFf7aW+mCt938JXpReLK2vFL8bGV4hUXLZyM8iuw2MQ1FWvSoahXx + c69qOO1ANFkKfk1nXa/GZfDbzE5YdVMJM10TqsxU41anJTytWgWypCUVhyPalILvZJ34 + IO/D21VtD25xWLDSiidBtkYVbUhZMcPKpGJ0Bt58gpr0V22sGz7PTpQ54lkRcfKdCXG4 + FvE9Pb4ZugRhmt5UXSeP+lWZjknMbHiRWNzGb8N5nxr01eDWFmh8un0oFhPhxvUqJT34 + Jf9RILQScBdJrKMwdYPw0ef6QqCeoYSXJ915rPzX2Y+Zzg3ij5huGHH61QHNf2birwU/ + t0zg== +X-Received: by 10.180.221.38 with SMTP id qb6mr17564618wic.8.1384287073156; + Tue, 12 Nov 2013 12:11:13 -0800 (PST) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id + ey4sm48137633wic.11.2013.11.12.12.11.12 for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Tue, 12 Nov 2013 12:11:12 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v4 5/7] emacs: help: add base-keymap +Date: Tue, 12 Nov 2013 20:10:57 +0000 +Message-Id: <1384287059-3525-6-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1384287059-3525-1-git-send-email-markwalters1009@gmail.com> +References: <1384287059-3525-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: Tue, 12 Nov 2013 20:18:23 -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 33790e2..7b1fc33 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) +@@ -293,7 +293,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))) + (mapconcat #'identity desc-list "\n"))))) + (setq doc (replace-match desc 1 1 doc))) +-- +1.7.9.1 + -- 2.26.2