1 Return-Path: <pieter@praet.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 3082D431FBD
\r
6 for <notmuch@notmuchmail.org>; Wed, 18 Jan 2012 02:09:33 -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 BEf8hq5+ktzd for <notmuch@notmuchmail.org>;
\r
16 Wed, 18 Jan 2012 02:09:32 -0800 (PST)
\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com
\r
18 [74.125.82.45]) (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 0E85A431FAE for <notmuch@notmuchmail.org>; Wed, 18 Jan 2012 02:09:31 -0800
\r
22 Received: by wgbdr13 with SMTP id dr13so2154329wgb.2
\r
23 for <notmuch@notmuchmail.org>; Wed, 18 Jan 2012 02:09:30 -0800 (PST)
\r
24 Received: by 10.180.109.77 with SMTP id hq13mr29978785wib.7.1326881370925;
\r
25 Wed, 18 Jan 2012 02:09:30 -0800 (PST)
\r
26 Received: from localhost ([109.131.97.13])
\r
27 by mx.google.com with ESMTPS id em13sm21586448wid.7.2012.01.18.02.09.29
\r
28 (version=TLSv1/SSLv3 cipher=OTHER);
\r
29 Wed, 18 Jan 2012 02:09:30 -0800 (PST)
\r
30 From: Pieter Praet <pieter@praet.org>
\r
31 To: Jani Nikula <jani@nikula.org>, David Edmondson <dme@dme.org>,
\r
32 Austin Clements <amdragon@MIT.EDU>
\r
33 Subject: Re: [PATCH] v2 [RFC] emacs: merge overhauled
\r
34 `notmuch-cycle-notmuch-buffers' into `notmuch'
\r
35 In-Reply-To: <87ehuzl5fg.fsf@nikula.org>
\r
36 References: <87r4yza95m.fsf@praet.org>
\r
37 <1326732415-21894-1-git-send-email-pieter@praet.org>
\r
38 <87ehuzl5fg.fsf@nikula.org>
\r
39 User-Agent: Notmuch/0.11+86~g67f4140 (http://notmuchmail.org) Emacs/23.3.1
\r
40 (x86_64-unknown-linux-gnu)
\r
41 Date: Wed, 18 Jan 2012 11:07:42 +0100
\r
42 Message-ID: <87d3ah8gsx.fsf@praet.org>
\r
44 Content-Type: text/plain; charset=us-ascii
\r
45 Cc: Notmuch Mail <notmuch@notmuchmail.org>
\r
46 X-BeenThere: notmuch@notmuchmail.org
\r
47 X-Mailman-Version: 2.1.13
\r
49 List-Id: "Use and development of the notmuch mail system."
\r
50 <notmuch.notmuchmail.org>
\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
54 List-Post: <mailto:notmuch@notmuchmail.org>
\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
58 X-List-Received-Date: Wed, 18 Jan 2012 10:09:33 -0000
\r
60 On Mon, 16 Jan 2012 23:10:27 +0200, Jani Nikula <jani@nikula.org> wrote:
\r
61 > On Mon, 16 Jan 2012 17:46:55 +0100, Pieter Praet <pieter@praet.org> wrote:
\r
62 > > Make `notmuch-cycle-notmuch-buffers' more Lispy and merge into `notmuch',
\r
63 > > eliminating the need to hog yet another keybind.
\r
65 > What does "merge" mean here? [...]
\r
67 "One function ought to be enough for anybody." ? :) [1]
\r
70 > [...] Will it still be possible for me to hit one
\r
71 > key to unconditionally get to notmuch-hello, and another to cycle
\r
72 > through the buffers? I wouldn't want to lose that ability.
\r
75 Sure, but then your new key should be bound to `notmuch' instead
\r
76 of `notmuch-cycle-notmuch-buffers', and the key originally bound
\r
77 to `notmuch' should be remapped to `notmuch-hello'.
\r
81 > > emacs/notmuch.el | 40 ++++++++++++++--------------------------
\r
82 > > 1 files changed, 14 insertions(+), 26 deletions(-)
\r
84 > > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
85 > > index ef4dcc7..539b3a0 100644
\r
86 > > --- a/emacs/notmuch.el
\r
87 > > +++ b/emacs/notmuch.el
\r
88 > > @@ -1067,7 +1067,20 @@ current search results AND that are tagged with the given tag."
\r
89 > > (defun notmuch ()
\r
90 > > "Run notmuch and display saved searches, known tags, etc."
\r
92 > > - (notmuch-hello))
\r
93 > > + (let* ((old-buffer (current-buffer))
\r
94 > > + (interesting-buffers
\r
95 > > + (delq nil (mapcar (lambda (b)
\r
96 > > + (if (notmuch-interesting-buffer b) b))
\r
97 > > + (buffer-list))))
\r
98 > > + (next-buffer (first
\r
99 > > + (delq nil (mapcar (lambda (b)
\r
100 > > + (unless (eq old-buffer b) b))
\r
101 > > + interesting-buffers)))))
\r
102 > > + (if next-buffer
\r
104 > > + (switch-to-buffer next-buffer)
\r
105 > > + (bury-buffer old-buffer))
\r
106 > > + (notmuch-hello))))
\r
108 > notmuch-cycle-notmuch-buffers pretty much explains in the name what it
\r
109 > does, but additionally it has documentation, and explanatory
\r
110 > comments. Please don't drop those.
\r
116 Less intrusive patch available [2].
\r
125 > > (defun notmuch-interesting-buffer (b)
\r
126 > > "Is the current buffer of interest to a notmuch user?"
\r
127 > > @@ -1078,31 +1091,6 @@ current search results AND that are tagged with the given tag."
\r
128 > > message-mode))))
\r
131 > > -(defun notmuch-cycle-notmuch-buffers ()
\r
132 > > - "Cycle through any existing notmuch buffers (search, show or hello).
\r
134 > > -If the current buffer is the only notmuch buffer, bury it. If no
\r
135 > > -notmuch buffers exist, run `notmuch'."
\r
136 > > - (interactive)
\r
138 > > - (let (start first)
\r
139 > > - ;; If the current buffer is a notmuch buffer, remember it and then
\r
141 > > - (when (notmuch-interesting-buffer (current-buffer))
\r
142 > > - (setq start (current-buffer))
\r
143 > > - (bury-buffer))
\r
145 > > - ;; Find the first notmuch buffer.
\r
146 > > - (setq first (loop for buffer in (buffer-list)
\r
147 > > - if (notmuch-interesting-buffer buffer)
\r
148 > > - return buffer))
\r
151 > > - ;; If the first one we found is any other than the starting
\r
152 > > - ;; buffer, switch to it.
\r
153 > > - (unless (eq first start)
\r
154 > > - (switch-to-buffer first))
\r
157 > > (setq mail-user-agent 'notmuch-user-agent)
\r
162 > > _______________________________________________
\r
163 > > notmuch mailing list
\r
164 > > notmuch@notmuchmail.org
\r
165 > > http://notmuchmail.org/mailman/listinfo/notmuch
\r
173 [1] http://www.computerworld.com/s/article/9101699
\r
174 [2] id:"1326881084-25432-1-git-send-email-pieter@praet.org"
\r