1 Return-Path: <jani@nikula.org>
\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 0AEEC431FD0
\r
6 for <notmuch@notmuchmail.org>; Tue, 27 Dec 2011 11:23:37 -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 uzsMNUlQCmvo for <notmuch@notmuchmail.org>;
\r
16 Tue, 27 Dec 2011 11:23:32 -0800 (PST)
\r
17 Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com
\r
18 [74.125.83.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
19 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
20 73ACD431FB6 for <notmuch@notmuchmail.org>; Tue, 27 Dec 2011 11:23:32 -0800
\r
22 Received: by eekd41 with SMTP id d41so14376926eek.26
\r
23 for <notmuch@notmuchmail.org>; Tue, 27 Dec 2011 11:23:29 -0800 (PST)
\r
24 Received: by 10.213.32.71 with SMTP id b7mr445864ebd.59.1325013809474;
\r
25 Tue, 27 Dec 2011 11:23:29 -0800 (PST)
\r
26 Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi.
\r
28 by mx.google.com with ESMTPS id a60sm110385910eeb.4.2011.12.27.11.23.26
\r
29 (version=SSLv3 cipher=OTHER); Tue, 27 Dec 2011 11:23:27 -0800 (PST)
\r
30 From: Jani Nikula <jani@nikula.org>
\r
31 To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org
\r
32 Subject: Re: [PATCH] emacs: Cycle through notmuch buffers rather than jumping
\r
34 In-Reply-To: <1324983044-29249-1-git-send-email-dme@dme.org>
\r
35 References: <1324983044-29249-1-git-send-email-dme@dme.org>
\r
36 User-Agent: Notmuch/0.10.2+142~g597904a (http://notmuchmail.org) Emacs/23.3.1
\r
38 Date: Tue, 27 Dec 2011 21:23:25 +0200
\r
39 Message-ID: <87vcp1es42.fsf@nikula.org>
\r
41 Content-Type: text/plain; charset=us-ascii
\r
42 X-BeenThere: notmuch@notmuchmail.org
\r
43 X-Mailman-Version: 2.1.13
\r
45 List-Id: "Use and development of the notmuch mail system."
\r
46 <notmuch.notmuchmail.org>
\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
50 List-Post: <mailto:notmuch@notmuchmail.org>
\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
54 X-List-Received-Date: Tue, 27 Dec 2011 19:23:37 -0000
\r
56 On Tue, 27 Dec 2011 10:50:44 +0000, David Edmondson <dme@dme.org> wrote:
\r
57 > As suggested by j4ni in #notmuch, rename
\r
58 > `notmuch-jump-to-recent-buffer' as `notmuch-cycle-notmuch-buffers' and
\r
59 > have it behave accordingly.
\r
61 Hi David, thanks for submitting this. It works nicely, and IMHO it's
\r
62 *much* more useful than notmuch-jump-to-recent-buffer.
\r
64 I'm wondering whether message-mode should be included. I tried it, and
\r
65 it's useful in my interrupted-more-often-than-I'd-like-to workflow...
\r
73 > emacs/notmuch.el | 39 +++++++++++++++++++++++++++------------
\r
74 > 1 files changed, 27 insertions(+), 12 deletions(-)
\r
76 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
77 > index c678c93..4844385 100644
\r
78 > --- a/emacs/notmuch.el
\r
79 > +++ b/emacs/notmuch.el
\r
80 > @@ -1056,20 +1056,35 @@ current search results AND that are tagged with the given tag."
\r
84 > -(defun notmuch-jump-to-recent-buffer ()
\r
85 > - "Jump to the most recent notmuch buffer (search, show or hello).
\r
86 > +(defun notmuch-cycle-notmuch-buffers ()
\r
87 > + "Cycle through any existing notmuch buffers (search, show or hello).
\r
89 > -If no recent buffer is found, run `notmuch'."
\r
90 > +If the current buffer is the only notmuch buffer, bury it. If no
\r
91 > +notmuch buffers exist, run `notmuch'."
\r
94 > - (loop for buffer in (buffer-list)
\r
95 > - if (with-current-buffer buffer
\r
96 > - (memq major-mode '(notmuch-show-mode
\r
97 > - notmuch-search-mode
\r
98 > - notmuch-hello-mode)))
\r
99 > - return buffer)))
\r
101 > - (switch-to-buffer last)
\r
103 > + (let (start first)
\r
104 > + ;; If the current buffer is a notmuch buffer, remember it and then
\r
106 > + (when (memq major-mode '(notmuch-show-mode
\r
107 > + notmuch-search-mode
\r
108 > + notmuch-hello-mode))
\r
109 > + (setq start (current-buffer))
\r
112 > + ;; Find the first notmuch buffer.
\r
113 > + (setq first (loop for buffer in (buffer-list)
\r
114 > + if (with-current-buffer buffer
\r
115 > + (memq major-mode '(notmuch-show-mode
\r
116 > + notmuch-search-mode
\r
117 > + notmuch-hello-mode)))
\r
118 > + return buffer))
\r
121 > + ;; If the first one we found is any other than the starting
\r
122 > + ;; buffer, switch to it.
\r
123 > + (unless (eq first start)
\r
124 > + (switch-to-buffer first))
\r
127 > (setq mail-user-agent 'notmuch-user-agent)
\r
131 > _______________________________________________
\r
132 > notmuch mailing list
\r
133 > notmuch@notmuchmail.org
\r
134 > http://notmuchmail.org/mailman/listinfo/notmuch
\r