1 Return-Path: <amdragon@mit.edu>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 1895D429E2E
\r
6 for <notmuch@notmuchmail.org>; Fri, 8 Nov 2013 12:00:28 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id m+2bPpDWYvBM for <notmuch@notmuchmail.org>;
\r
16 Fri, 8 Nov 2013 12:00:20 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 94EF4429E35
\r
22 for <notmuch@notmuchmail.org>; Fri, 8 Nov 2013 12:00:20 -0800 (PST)
\r
23 X-AuditID: 1209190f-b7f7b8e0000053dd-5a-527d42d342d3
\r
24 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])
\r
25 (using TLS with cipher AES256-SHA (256/256 bits))
\r
26 (Client did not present a certificate)
\r
27 by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP
\r
28 id 6F.70.21469.3D24D725; Fri, 8 Nov 2013 15:00:19 -0500 (EST)
\r
29 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])
\r
30 by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id rA8K0IHv002993;
\r
31 Fri, 8 Nov 2013 15:00:19 -0500
\r
32 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
33 (authenticated bits=0)
\r
34 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
35 by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id rA8K0GAx022589
\r
36 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
\r
37 Fri, 8 Nov 2013 15:00:17 -0500
\r
38 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)
\r
39 (envelope-from <amdragon@mit.edu>)
\r
40 id 1VesE4-0002xQ-8f; Fri, 08 Nov 2013 15:00:16 -0500
\r
41 Date: Fri, 8 Nov 2013 15:00:16 -0500
\r
42 From: Austin Clements <amdragon@MIT.EDU>
\r
43 To: Mark Walters <markwalters1009@gmail.com>
\r
44 Subject: Re: [PATCH v3 0/7] emacs: help: remap keybindings
\r
45 Message-ID: <20131108200016.GN29298@mit.edu>
\r
46 References: <1383932419-12533-1-git-send-email-markwalters1009@gmail.com>
\r
48 Content-Type: text/plain; charset=us-ascii
\r
49 Content-Disposition: inline
\r
50 In-Reply-To: <1383932419-12533-1-git-send-email-markwalters1009@gmail.com>
\r
51 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
52 X-Brightmail-Tracker:
\r
53 H4sIAAAAAAAAA+NgFvrHIsWRmVeSWpSXmKPExsUixCmqrXvZqTbI4NUUE4vVc3ksrt+cyezA
\r
54 5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZexdc5elYLpCxaVfGg2M7ZJdjJwcEgImEiee
\r
55 7mSHsMUkLtxbz9bFyMUhJDCbSeLDu4VgCSGBDYwSb5cYQiROMUksWjybHcJZwijRvPEEG0gV
\r
56 i4CKxP53y8E62AQ0JLbtX84IYosI6EjcPrQALM4sIC3x7XczUxcjB4ewgJXEnV92IGFeoJKX
\r
57 /c+YQcJCAp4SD/ZZQ4QFJU7OfMIC0aklcePfS7BOkCnL/3GAmJwCXhJvrySDVIgC7Z9ychvb
\r
58 BEahWUiaZyFpnoXQvICReRWjbEpulW5uYmZOcWqybnFyYl5eapGuiV5uZoleakrpJkZwMEvy
\r
59 72D8dlDpEKMAB6MSD+8PjdogIdbEsuLK3EOMkhxMSqK8W62BQnxJ+SmVGYnFGfFFpTmpxYcY
\r
60 JTiYlUR4S1WAcrwpiZVVqUX5MClpDhYlcd6bHPZBQgLpiSWp2ampBalFMFkZDg4lCd55jkCN
\r
61 gkWp6akVaZk5JQhpJg5OkOE8QMPdQGp4iwsSc4sz0yHypxgVpcR5lYHpQkgAJJFRmgfXC0s2
\r
62 rxjFgV4R5v0N0s4DTFRw3a+ABjMBDQ75VQkyuCQRISXVwGgY/bp/eUN5pejBCXPX+kaJvj9c
\r
63 VRrkwbDI5XNBv+KqNYY/a4+z3nnk1+l18JrC1qUcyRJZXvwCsT3JfApfpjfWzX7dtHJ5lv+X
\r
64 kMtznm76c0hH8pPPpEjGs76nJuUv1f1XtWhZmdsi24kn2eNrL/14/XFiQtuZ97fiAs5eNPzZ
\r
65 UPr3oIaD0yolluKMREMt5qLiRADVlghDEQMAAA==
\r
66 Cc: notmuch@notmuchmail.org
\r
67 X-BeenThere: notmuch@notmuchmail.org
\r
68 X-Mailman-Version: 2.1.13
\r
70 List-Id: "Use and development of the notmuch mail system."
\r
71 <notmuch.notmuchmail.org>
\r
72 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
73 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
74 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
75 List-Post: <mailto:notmuch@notmuchmail.org>
\r
76 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
77 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
78 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
79 X-List-Received-Date: Fri, 08 Nov 2013 20:00:28 -0000
\r
83 Quoth Mark Walters on Nov 08 at 5:40 pm:
\r
84 > This is version 3 of the series. v2 is at
\r
85 > id:1383870096-14627-1-git-send-email-markwalters1009@gmail.com
\r
87 > The changes are in response to Austin's review of v2. I have not
\r
88 > changed notmuch-describe-key.
\r
90 > The other change is to add a base-keymap to look up the remapped
\r
91 > commands in (since notmuch-substitute-command-keys could refer to
\r
92 > something other than the current keymap). Currently this never happens
\r
93 > but this makes the code more robust.
\r
95 > The final patch of the series is (probably) just for testing
\r
96 > purposes. It lets you call notmuch-help and specify which mode you
\r
97 > want to display help for. This means you can call it without having
\r
98 > the mode as current-mode and hence test the base-keymap code.
\r
100 > Finally the diff from v2 below (with the testing patch omitted) is below.
\r
106 > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
\r
107 > index ef616d5..4b3a86e 100644
\r
108 > --- a/emacs/notmuch-lib.el
\r
109 > +++ b/emacs/notmuch-lib.el
\r
110 > @@ -261,7 +261,7 @@ It does not prepend if ACTUAL-KEY is already listed in TAIL."
\r
114 > -(defun notmuch-describe-remaps (remap-keymap ua-keys prefix tail)
\r
115 > +(defun notmuch-describe-remaps (remap-keymap ua-keys base-keymap prefix tail)
\r
116 > ;; Remappings are represented as a binding whose first "event" is
\r
117 > ;; 'remap. Hence, if the keymap has any remappings, it will have a
\r
118 > ;; binding whose "key" is 'remap, and whose "binding" is itself a
\r
119 > @@ -272,11 +272,11 @@ It does not prepend if ACTUAL-KEY is already listed in TAIL."
\r
121 > (lambda (actual-key)
\r
122 > (setq tail (notmuch-describe-key actual-key binding prefix ua-keys tail)))
\r
123 > - (where-is-internal command)))
\r
124 > + (where-is-internal command base-keymap)))
\r
128 > -(defun notmuch-describe-keymap (keymap ua-keys &optional prefix tail)
\r
129 > +(defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail)
\r
130 > "Return a list of cons cells, each describing one binding in KEYMAP.
\r
132 > Each cons cell consists of a string giving a human-readable
\r
133 > @@ -291,13 +291,12 @@ prefix argument. PREFIX and TAIL are used internally."
\r
134 > (lambda (key binding)
\r
135 > (cond ((mouse-event-p key) nil)
\r
136 > ((keymapp binding)
\r
137 > - (if (eq key 'remap)
\r
140 > + (if (eq key 'remap)
\r
141 > (notmuch-describe-remaps
\r
142 > - binding ua-keys prefix tail))
\r
144 > + binding ua-keys base-keymap prefix tail)
\r
145 > (notmuch-describe-keymap
\r
146 > - binding ua-keys (notmuch-prefix-key-description key) tail))))
\r
147 > + binding ua-keys base-keymap (notmuch-prefix-key-description key) tail))))
\r
149 > (setq tail (notmuch-describe-key (vector key) binding prefix ua-keys tail)))))
\r
151 > @@ -310,7 +309,7 @@ prefix argument. PREFIX and TAIL are used internally."
\r
152 > (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))
\r
153 > (keymap (symbol-value (intern keymap-name)))
\r
154 > (ua-keys (where-is-internal 'universal-argument keymap t))
\r
155 > - (desc-alist (notmuch-describe-keymap keymap ua-keys))
\r
156 > + (desc-alist (notmuch-describe-keymap keymap ua-keys keymap))
\r
157 > (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist))
\r
158 > (desc (mapconcat #'identity desc-list "\n")))
\r
159 > (setq doc (replace-match desc 1 1 doc)))
\r
163 > Mark Walters (7):
\r
164 > emacs: help: check for nil key binding
\r
165 > emacs: help: remove duplicate bindings
\r
166 > emacs: help: split out notmuch-describe-key as a function
\r
167 > emacs: help: add base-keymap
\r
168 > emacs: help: add a special function to deal with remaps
\r
169 > emacs: tree: use remap for the over-ridden global bindings
\r
170 > emacs: help: base-keymap-test-help
\r
172 > emacs/notmuch-lib.el | 79 ++++++++++++++++++++++++++++++++++--------------
\r
173 > emacs/notmuch-tree.el | 8 ++--
\r
174 > 2 files changed, 60 insertions(+), 27 deletions(-)
\r