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 87478431FC2
\r
6 for <notmuch@notmuchmail.org>; Tue, 15 Jul 2014 07:06:22 -0700 (PDT)
\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 HEQw+xwK3ArC for <notmuch@notmuchmail.org>;
\r
16 Tue, 15 Jul 2014 07:06:17 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (dmz-mailsec-scanner-6.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 46E5E431FBD
\r
22 for <notmuch@notmuchmail.org>; Tue, 15 Jul 2014 07:06:17 -0700 (PDT)
\r
23 X-AuditID: 12074423-f79bf6d000007580-ff-53c53556efd4
\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-6.mit.edu (Symantec Messaging Gateway) with SMTP
\r
28 id 06.09.30080.65535C35; Tue, 15 Jul 2014 10:06:14 -0400 (EDT)
\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 s6FE6Dv1018297;
\r
31 Tue, 15 Jul 2014 10:06:13 -0400
\r
32 Received: from drake.dyndns.org
\r
33 (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com
\r
34 [216.15.114.40]) (authenticated bits=0)
\r
35 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
36 by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s6FE6AAu008823
\r
37 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
38 Tue, 15 Jul 2014 10:06:12 -0400
\r
39 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)
\r
40 (envelope-from <amdragon@mit.edu>)
\r
41 id 1X73Mv-0000gx-2K; Tue, 15 Jul 2014 10:06:09 -0400
\r
42 From: Austin Clements <amdragon@MIT.EDU>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH v2 0/2] emacs: Shortcut keys to saved searches
\r
45 Date: Tue, 15 Jul 2014 10:06:04 -0400
\r
46 Message-Id: <1405433166-2198-1-git-send-email-amdragon@mit.edu>
\r
47 X-Mailer: git-send-email 2.0.0
\r
48 In-Reply-To: <1405353735-26244-1-git-send-email-amdragon@mit.edu>
\r
49 References: <1405353735-26244-1-git-send-email-amdragon@mit.edu>
\r
50 X-Brightmail-Tracker:
\r
51 H4sIAAAAAAAAA+NgFrrAIsWRmVeSWpSXmKPExsUixCmqrRtmejTYoLnFyuJGazejxb47W5gs
\r
52 Vs/lsbh+cyazA4vHrud/mTx2zrrL7vFs1S1mjy2H3jMHsERx2aSk5mSWpRbp2yVwZWyde4ip
\r
53 oFm+4taDG4wNjGcluhg5OSQETCQOLpjFBGGLSVy4t56ti5GLQ0hgNpPE3bOzWCCcjYwSV1vn
\r
54 MUE4d5gkml5fZQVpERKYyyhx4LItiM0moCGxbf9yRhBbREBaYufd2WA1zAK2Ep9a/4OtEBaw
\r
55 k/i+/z0ziM0ioCpx/ctzdhCbV8BeYt69LlaIM+QkGm58YgOxOQUcJd68OAa1y0Fi05rPTBMY
\r
56 +RcwMqxilE3JrdLNTczMKU5N1i1OTszLSy3SNdPLzSzRS00p3cQICjh2F+UdjH8OKh1iFOBg
\r
57 VOLhlXh3OFiINbGsuDL3EKMkB5OSKG8x29FgIb6k/JTKjMTijPii0pzU4kOMEhzMSiK8kiZA
\r
58 Od6UxMqq1KJ8mJQ0B4uSOO9ba6tgIYH0xJLU7NTUgtQimKwMB4eSBC8zSKNgUWp6akVaZk4J
\r
59 QpqJgxNkOA/QcF6w4cUFibnFmekQ+VOMilLivCeMgRICIImM0jy4XlhCeMUoDvSKMO8VkCoe
\r
60 YDKB634FNJgJaHB5zWGQwSWJCCmpBsasIGnusvAfOyodGNiZ3rMc+JvQnOvb+abr/Qtphpk3
\r
61 4rUWTVVczMe+veO5VEPKpYZfZ5NOPtJLtGcTdNnymrFc+JFw3r6TayStnVgPvmvv7LqUes2f
\r
62 Iz2ZK7w458f5ZX9juz8+3DVXc83+y9k2h9iYJ997oz/rw9lvJ7494n+0pvSFRPu1MEclluKM
\r
63 REMt5qLiRADCQO0m4wIAAA==
\r
64 X-BeenThere: notmuch@notmuchmail.org
\r
65 X-Mailman-Version: 2.1.13
\r
67 List-Id: "Use and development of the notmuch mail system."
\r
68 <notmuch.notmuchmail.org>
\r
69 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
70 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
72 List-Post: <mailto:notmuch@notmuchmail.org>
\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
74 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
75 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
76 X-List-Received-Date: Tue, 15 Jul 2014 14:06:22 -0000
\r
78 This is version 2 of
\r
79 id:1405353735-26244-1-git-send-email-amdragon@mit.edu and addresses
\r
80 Mark's comments in id:87egxnd4aq.fsf@qmul.ac.uk.
\r
82 The diff from v1 is below.
\r
84 diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
\r
85 index cb1ae10..9cb1e6a 100644
\r
86 --- a/emacs/notmuch-jump.el
\r
87 +++ b/emacs/notmuch-jump.el
\r
88 @@ -53,20 +53,19 @@ (defun notmuch-jump-search ()
\r
89 (setq action-map (nreverse action-map))
\r
92 - (notmuch-jump action-map "Search ")
\r
93 - (error "No shortcut keys for saved searches. Please customize notmuch-saved-searches."))))
\r
94 + (notmuch-jump action-map "Search: ")
\r
95 + (error "To use notmuch-jump, please customize shortcut keys in notmuch-saved-searches."))))
\r
97 (defvar notmuch-jump--action nil)
\r
99 (defun notmuch-jump (action-map prompt)
\r
100 "Interactively prompt for one of the keys in ACTION-MAP.
\r
102 -Displays a pop-up temporary buffer with a summary of all bindings
\r
103 -in ACTION-MAP, reads a key from the minibuffer, and performs the
\r
104 -corresponding action. The prompt can be canceled with C-g.
\r
105 -PROMPT must be a string to use for the prompt if this command was
\r
106 -not invoked directly by a key binding (e.g., it was invoked
\r
107 -through M-x). PROMPT should include a space at the end.
\r
108 +Displays a summary of all bindings in ACTION-MAP in the
\r
109 +minibuffer, reads a key from the minibuffer, and performs the
\r
110 +corresponding action. The prompt can be canceled with C-g or
\r
111 +RET. PROMPT must be a string to use for the prompt. PROMPT
\r
112 +should include a space at the end.
\r
114 ACTION-MAP must be a list of triples of the form
\r
116 @@ -82,16 +81,9 @@ (defun notmuch-jump (action-map prompt)
\r
118 (notmuch-jump--insert-items (window-body-width) items)
\r
121 - (if (eq this-original-command this-command)
\r
122 - ;; Make it look like we're just part of any regular
\r
123 - ;; submap prompt (like C-x, C-c, etc.)
\r
124 - (concat (format-kbd-macro (this-command-keys)) "-")
\r
125 - ;; We were invoked through something like M-x
\r
128 (concat table "\n\n"
\r
129 - (propertize prompt-text 'face 'minibuffer-prompt)))
\r
130 + (propertize prompt 'face 'minibuffer-prompt)))
\r
131 ;; By default, the minibuffer applies the minibuffer face to
\r
132 ;; the entire prompt. However, we want to clearly
\r
133 ;; distinguish bindings (which we put in the prompt face
\r
134 @@ -121,14 +113,14 @@ (defun notmuch-jump--format-actions (action-map)
\r
136 ;; Compute the maximum key description width
\r
137 (let ((key-width 1))
\r
138 - (dolist (action action-map)
\r
139 + (dolist (entry action-map)
\r
142 - (string-width (format-kbd-macro (first action))))))
\r
143 + (string-width (format-kbd-macro (first entry))))))
\r
144 ;; Format each action
\r
145 - (mapcar (lambda (action)
\r
146 - (let ((key (format-kbd-macro (first action)))
\r
147 - (desc (second action)))
\r
148 + (mapcar (lambda (entry)
\r
149 + (let ((key (format-kbd-macro (first entry)))
\r
150 + (desc (second entry)))
\r
152 (propertize key 'face 'minibuffer-prompt)
\r
153 (make-string (- key-width (length key)) ? )
\r
154 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
\r
155 index 135422d..b338aaa 100644
\r
156 --- a/emacs/notmuch-lib.el
\r
157 +++ b/emacs/notmuch-lib.el
\r
159 (require 'mm-decode)
\r
162 +(autoload 'notmuch-jump-search "notmuch-jump"
\r
163 + "Jump to a saved search by shortcut key." t)
\r
165 (defvar notmuch-command "notmuch"
\r
166 "Command to run the notmuch binary.")
\r
168 @@ -134,8 +137,6 @@ (defvar notmuch-common-keymap
\r
170 "Keymap shared by all notmuch modes.")
\r
172 -(autoload 'notmuch-jump-search "notmuch-jump" "Jump to a saved search by shortcut key." t)
\r
174 ;; By default clicking on a button does not select the window
\r
175 ;; containing the button (as opposed to clicking on a widget which
\r
176 ;; does). This means that the button action is then executed in the
\r