1 Return-Path: <markwalters1009@gmail.com>
\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 68DEF431FB6
\r
6 for <notmuch@notmuchmail.org>; Mon, 23 Sep 2013 12:53:21 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,
\r
14 RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id ne7fBCma2b-0 for <notmuch@notmuchmail.org>;
\r
18 Mon, 23 Sep 2013 12:53:13 -0700 (PDT)
\r
19 Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com
\r
20 [74.125.82.51]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
21 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
22 830A5431FBD for <notmuch@notmuchmail.org>; Mon, 23 Sep 2013 12:53:08 -0700
\r
24 Received: by mail-wg0-f51.google.com with SMTP id c11so3491517wgh.18
\r
25 for <notmuch@notmuchmail.org>; Mon, 23 Sep 2013 12:53:06 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:in-reply-to:references;
\r
28 bh=HgxN6x1qQdjHI6qc8bjwEmxrPk7c6RCeqYp/D2R8M7k=;
\r
29 b=QpVd0/5XMROzgkUBpGhUa9W5sTO4KmZz7a3fPy0rcbMEho164R5QnYSHIVzvSQisXK
\r
30 oSfqyah0znrr2deNiX+3G0WNT87V6LurZ4mVmaJfkZcGk8bVaaGar8A1qD/2NeUbD+0X
\r
31 7mThx1dGirDLmiSITxA/bdNZgI1yHnD/koZ1DSvdVu9IHBY2uAaP/BWvyIZ1hnE8rhlg
\r
32 LRy6UruC3Cb3Y8iduE/Z7E7FAAoA2siEVcznXz2OKnn3Av3nsEcx07VLou3vT5wSv7Ea
\r
33 B4JHc4mHYRWMJAwVA2yhp5IGHpnh/8GKJ29rVU8oX6bXxCL7KNAL99d+18g5v38t/HEA
\r
35 X-Received: by 10.180.76.171 with SMTP id l11mr14907596wiw.39.1379965985973;
\r
36 Mon, 23 Sep 2013 12:53:05 -0700 (PDT)
\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])
\r
38 by mx.google.com with ESMTPSA id d11sm722825wic.4.1969.12.31.16.00.00
\r
39 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
40 Mon, 23 Sep 2013 12:53:05 -0700 (PDT)
\r
41 From: Mark Walters <markwalters1009@gmail.com>
\r
42 To: notmuch@notmuchmail.org
\r
43 Subject: [PATCH 1/2] contrib: pick: move M-RET to prefix-arg RET
\r
44 Date: Mon, 23 Sep 2013 20:52:58 +0100
\r
45 Message-Id: <1379965979-14752-2-git-send-email-markwalters1009@gmail.com>
\r
46 X-Mailer: git-send-email 1.7.9.1
\r
47 In-Reply-To: <1379965979-14752-1-git-send-email-markwalters1009@gmail.com>
\r
48 References: <1379965979-14752-1-git-send-email-markwalters1009@gmail.com>
\r
49 X-BeenThere: notmuch@notmuchmail.org
\r
50 X-Mailman-Version: 2.1.13
\r
52 List-Id: "Use and development of the notmuch mail system."
\r
53 <notmuch.notmuchmail.org>
\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
57 List-Post: <mailto:notmuch@notmuchmail.org>
\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
60 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
61 X-List-Received-Date: Mon, 23 Sep 2013 19:53:21 -0000
\r
63 In pick the user has the option of showing the selected message in a
\r
64 subpane (the message pane) or in the full frame. This is customisable
\r
65 using the variable notmuch-pick-show-out. At the moment RET is bound
\r
66 to the default option and M-RET the other option. This is
\r
67 messy and involves tricks to make sure the keymap is setup at the
\r
70 This changes this to prefix-arg RET for the other option which
\r
71 simplifies the code and makes things cleaner.
\r
73 contrib/notmuch-pick/notmuch-pick.el | 51 +++++++++++++--------------------
\r
74 1 files changed, 20 insertions(+), 31 deletions(-)
\r
76 diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
\r
77 index 054762b..3afdea4 100644
\r
78 --- a/contrib/notmuch-pick/notmuch-pick.el
\r
79 +++ b/contrib/notmuch-pick/notmuch-pick.el
\r
81 "Showing message and thread structure."
\r
84 -;; This is ugly. We can't run setup-show-out until it has been defined
\r
85 -;; which needs the keymap to be defined. So we defer setting up to
\r
86 -;; notmuch-pick-init.
\r
87 (defcustom notmuch-pick-show-out nil
\r
88 "View selected messages in new window rather than split-pane."
\r
90 - :group 'notmuch-pick
\r
91 - :set (lambda (symbol value)
\r
92 - (set-default symbol value)
\r
93 - (when (fboundp 'notmuch-pick-setup-show-out)
\r
94 - (notmuch-pick-setup-show-out))))
\r
95 + :group 'notmuch-pick)
\r
97 (defcustom notmuch-pick-result-format
\r
98 `(("date" . "%12s ")
\r
99 @@ -241,7 +234,6 @@ FUNC."
\r
100 ;; Override because we want to close message pane first.
\r
101 (define-key map "m" (notmuch-pick-close-message-pane-and #'notmuch-mua-new-mail))
\r
103 - (define-key map [mouse-1] 'notmuch-pick-show-message)
\r
104 ;; these use notmuch-show functions directly
\r
105 (define-key map "|" 'notmuch-show-pipe-message)
\r
106 (define-key map "w" 'notmuch-show-save-attachments)
\r
107 @@ -261,6 +253,8 @@ FUNC."
\r
108 (define-key map "V" (notmuch-pick-close-message-pane-and #'notmuch-show-view-raw-message))
\r
110 ;; The main pick bindings
\r
111 + (define-key map (kbd "RET") 'notmuch-pick-show-message)
\r
112 + (define-key map [mouse-1] 'notmuch-pick-show-message)
\r
113 (define-key map "x" 'notmuch-pick-quit)
\r
114 (define-key map "A" 'notmuch-pick-archive-thread)
\r
115 (define-key map "a" 'notmuch-pick-archive-message-then-next)
\r
116 @@ -280,21 +274,6 @@ FUNC."
\r
118 (fset 'notmuch-pick-mode-map notmuch-pick-mode-map)
\r
120 -(defun notmuch-pick-setup-show-out ()
\r
121 - "Set up the keymap for showing a thread
\r
123 -This uses the value of the defcustom notmuch-pick-show-out to
\r
124 -decide whether to show a message in the message pane or in the
\r
126 - (let ((map notmuch-pick-mode-map))
\r
127 - (if notmuch-pick-show-out
\r
129 - (define-key map (kbd "M-RET") 'notmuch-pick-show-message)
\r
130 - (define-key map (kbd "RET") 'notmuch-pick-show-message-out))
\r
132 - (define-key map (kbd "RET") 'notmuch-pick-show-message)
\r
133 - (define-key map (kbd "M-RET") 'notmuch-pick-show-message-out)))))
\r
135 (defun notmuch-pick-get-message-properties ()
\r
136 "Return the properties of the current message as a plist.
\r
138 @@ -466,7 +445,7 @@ Does NOT change the database."
\r
140 (delete-window notmuch-pick-message-window)))))
\r
142 -(defun notmuch-pick-show-message ()
\r
143 +(defun notmuch-pick-show-message-in ()
\r
144 "Show the current message (in split-pane)."
\r
146 (let ((id (notmuch-pick-get-message-id))
\r
147 @@ -503,6 +482,17 @@ Does NOT change the database."
\r
148 (notmuch-pick-close-message-window)
\r
149 (notmuch-show id nil nil nil))))
\r
151 +(defun notmuch-pick-show-message (arg)
\r
152 + "Show the current message.
\r
154 +Shows in split pane or whole window according to value of
\r
155 +`notmuch-pick-show-out'. A prefix argument reverses the choice."
\r
156 + (interactive "P")
\r
157 + (if (or (and notmuch-pick-show-out (not arg))
\r
158 + (and (not notmuch-pick-show-out) arg))
\r
159 + (notmuch-pick-show-message-out)
\r
160 + (notmuch-pick-show-message-in)))
\r
162 (defun notmuch-pick-scroll-message-window ()
\r
163 "Scroll the message window (if it exists)"
\r
165 @@ -566,14 +556,14 @@ message will be \"unarchived\", i.e. the tag changes in
\r
168 (when (window-live-p notmuch-pick-message-window)
\r
169 - (notmuch-pick-show-message)))
\r
170 + (notmuch-pick-show-message-in)))
\r
172 (defun notmuch-pick-prev-message ()
\r
173 "Move to previous message."
\r
176 (when (window-live-p notmuch-pick-message-window)
\r
177 - (notmuch-pick-show-message)))
\r
178 + (notmuch-pick-show-message-in)))
\r
180 (defun notmuch-pick-prev-matching-message ()
\r
181 "Move to previous matching message."
\r
182 @@ -582,7 +572,7 @@ message will be \"unarchived\", i.e. the tag changes in
\r
183 (while (and (not (bobp)) (not (notmuch-pick-get-match)))
\r
185 (when (window-live-p notmuch-pick-message-window)
\r
186 - (notmuch-pick-show-message)))
\r
187 + (notmuch-pick-show-message-in)))
\r
189 (defun notmuch-pick-next-matching-message ()
\r
190 "Move to next matching message."
\r
191 @@ -591,7 +581,7 @@ message will be \"unarchived\", i.e. the tag changes in
\r
192 (while (and (not (eobp)) (not (notmuch-pick-get-match)))
\r
194 (when (window-live-p notmuch-pick-message-window)
\r
195 - (notmuch-pick-show-message)))
\r
196 + (notmuch-pick-show-message-in)))
\r
198 (defun notmuch-pick-refresh-view ()
\r
200 @@ -763,7 +753,7 @@ unchanged ADDRESS if parsing fails."
\r
201 (goto-char (point-max))
\r
203 (when notmuch-pick-open-target
\r
204 - (notmuch-pick-show-message)))))
\r
205 + (notmuch-pick-show-message-in)))))
\r
207 (defun notmuch-pick-insert-tree (tree depth tree-status first last)
\r
208 "Insert the message tree TREE at depth DEPTH in the current thread.
\r
209 @@ -952,7 +942,6 @@ The arguments are:
\r
210 (define-key notmuch-search-mode-map "Z" 'notmuch-pick-from-search-current-query)
\r
211 (define-key notmuch-search-mode-map (kbd "M-RET") 'notmuch-pick-from-search-thread)
\r
212 (define-key notmuch-show-mode-map "Z" 'notmuch-pick-from-show-current-query)
\r
213 -(notmuch-pick-setup-show-out)
\r
214 (message "Initialised notmuch-pick")
\r
216 (provide 'notmuch-pick)
\r