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 0CA04431FC0
\r
6 for <notmuch@notmuchmail.org>; Sat, 25 May 2013 14:13:58 -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 YJQy2YfHFowM for <notmuch@notmuchmail.org>;
\r
18 Sat, 25 May 2013 14:13:50 -0700 (PDT)
\r
19 Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com
\r
20 [209.85.212.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 842DC431FAF
\r
23 for <notmuch@notmuchmail.org>; Sat, 25 May 2013 14:13:50 -0700 (PDT)
\r
24 Received: by mail-wi0-f175.google.com with SMTP id hn14so602461wib.14
\r
25 for <notmuch@notmuchmail.org>; Sat, 25 May 2013 14:13:48 -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:x-mailer:in-reply-to:references;
\r
28 bh=LCryKNpKVZf+/D5yGSkmx2/9rmOsUrquIxXUP/gqt3o=;
\r
29 b=PY7ulkWhYdtAd0fBOSKJaaerIeToiuNilDYkTEabv5No6Oc7ItcPBWl8jP4GYtES2k
\r
30 UFX01Z+2C2+IohpfiwwpVrrq50KLvyIG8q9HM4cxojGvGfskXrNSntkJleGAj6wBbVPO
\r
31 IyzHucBTusAhRUlP3fPUpdEZ1eDT0IfWuKpkfXBw/g5/efmB8eZY02db+n+dDLs75IwF
\r
32 TxvYBJZ8kxaZZmPEPOMHHIuYDjXaafDED9aKgAAfFQLCk0Mfvz5NV/rBJ2Zg5E9VfpGW
\r
33 4qjBjJ6x2nAN8BF0LoDKJOCNLbYPtPRxpUnhWVC/colsp1GFuFOoICOG6lL86Z4hTIKt
\r
35 X-Received: by 10.180.126.101 with SMTP id mx5mr3226289wib.48.1369516427937;
\r
36 Sat, 25 May 2013 14:13:47 -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 m3sm7384625wij.5.2013.05.25.14.13.46
\r
39 for <multiple recipients>
\r
40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
41 Sat, 25 May 2013 14:13:47 -0700 (PDT)
\r
42 From: Mark Walters <markwalters1009@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH] emacs: add show view bindings to move to previous/next thread
\r
45 Date: Sat, 25 May 2013 22:13:30 +0100
\r
46 Message-Id: <1369516410-24860-1-git-send-email-markwalters1009@gmail.com>
\r
47 X-Mailer: git-send-email 1.7.9.1
\r
48 In-Reply-To: <1369484066-20228-1-git-send-email-jani@nikula.org>
\r
49 References: <1369484066-20228-1-git-send-email-jani@nikula.org>
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Sat, 25 May 2013 21:13:58 -0000
\r
64 From: Jani Nikula <jani@nikula.org>
\r
66 We have most of the plumbing in place, add the bindings M-n and M-p.
\r
68 emacs/notmuch-show.el | 30 +++++++++++++++++++++++++-----
\r
69 1 files changed, 25 insertions(+), 5 deletions(-)
\r
71 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
72 index d56154e..2b33007 100644
\r
73 --- a/emacs/notmuch-show.el
\r
74 +++ b/emacs/notmuch-show.el
\r
77 (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
\r
78 (declare-function notmuch-search-next-thread "notmuch" nil)
\r
79 +(declare-function notmuch-search-previous-thread "notmuch" nil)
\r
80 (declare-function notmuch-search-show-thread "notmuch" nil)
\r
82 (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
\r
83 @@ -1273,6 +1274,8 @@ reset based on the original query."
\r
84 (define-key map "P" 'notmuch-show-previous-message)
\r
85 (define-key map "n" 'notmuch-show-next-open-message)
\r
86 (define-key map "p" 'notmuch-show-previous-open-message)
\r
87 + (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)
\r
88 + (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)
\r
89 (define-key map (kbd "DEL") 'notmuch-show-rewind)
\r
90 (define-key map " " 'notmuch-show-advance-and-archive)
\r
91 (define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
\r
92 @@ -1834,16 +1837,33 @@ argument, hide all of the messages."
\r
94 (backward-button 1))
\r
96 -(defun notmuch-show-next-thread (&optional show-next)
\r
97 - "Move to the next item in the search results, if any."
\r
98 +(defun notmuch-show-next-thread (&optional show previous)
\r
99 + "Move to the next item in the search results, if any.
\r
101 +If SHOW is non-nil, open the next item in a show
\r
102 +buffer. Otherwise just highlight the next item in the search
\r
103 +buffer. If PREVIOUS is non-nil, move to the previous item in the
\r
104 +search results instead."
\r
106 (let ((parent-buffer notmuch-show-parent-buffer))
\r
107 (notmuch-kill-this-buffer)
\r
108 (when (buffer-live-p parent-buffer)
\r
109 (switch-to-buffer parent-buffer)
\r
110 - (notmuch-search-next-thread)
\r
112 - (notmuch-search-show-thread)))))
\r
113 + (and (if previous
\r
114 + (notmuch-search-previous-thread)
\r
115 + (notmuch-search-next-thread))
\r
117 + (notmuch-search-show-thread)))))
\r
119 +(defun notmuch-show-next-thread-show ()
\r
120 + "Show the next thread in the search results, if any."
\r
122 + (notmuch-show-next-thread t))
\r
124 +(defun notmuch-show-previous-thread-show ()
\r
125 + "Show the previous thread in the search results, if any."
\r
127 + (notmuch-show-next-thread t t))
\r
129 (defun notmuch-show-archive-thread (&optional unarchive)
\r
130 "Archive each message in thread.
\r