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 3133B431FBD
\r
6 for <notmuch@notmuchmail.org>; Wed, 18 Jan 2012 02:05:00 -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 UXjeZfwDL5ot for <notmuch@notmuchmail.org>;
\r
16 Wed, 18 Jan 2012 02:04:59 -0800 (PST)
\r
17 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com
\r
18 [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 1B7C7431FAE
\r
21 for <notmuch@notmuchmail.org>; Wed, 18 Jan 2012 02:04:58 -0800 (PST)
\r
22 Received: by werp13 with SMTP id p13so1243587wer.26
\r
23 for <notmuch@notmuchmail.org>; Wed, 18 Jan 2012 02:04:58 -0800 (PST)
\r
24 Received: by 10.216.131.76 with SMTP id l54mr9098571wei.34.1326881097930;
\r
25 Wed, 18 Jan 2012 02:04:57 -0800 (PST)
\r
26 Received: from localhost ([109.131.97.13])
\r
27 by mx.google.com with ESMTPS id em13sm21567366wid.7.2012.01.18.02.04.57
\r
28 (version=TLSv1/SSLv3 cipher=OTHER);
\r
29 Wed, 18 Jan 2012 02:04:57 -0800 (PST)
\r
30 From: Pieter Praet <pieter@praet.org>
\r
31 To: David Edmondson <dme@dme.org>, notmuch <notmuch@notmuchmail.org>
\r
32 Subject: Re: [PATCH] v2 [RFC] emacs: merge overhauled
\r
33 `notmuch-cycle-notmuch-buffers' into `notmuch'
\r
34 In-Reply-To: <cun39bftw9b.fsf@hotblack-desiato.hh.sledj.net>
\r
35 References: <87r4yza95m.fsf@praet.org>
\r
36 <1326732415-21894-1-git-send-email-pieter@praet.org>
\r
37 <cun39bftw9b.fsf@hotblack-desiato.hh.sledj.net>
\r
38 User-Agent: Notmuch/0.11+86~g67f4140 (http://notmuchmail.org) Emacs/23.3.1
\r
39 (x86_64-unknown-linux-gnu)
\r
40 Date: Wed, 18 Jan 2012 11:03:09 +0100
\r
41 Message-ID: <87fwfd8h0i.fsf@praet.org>
\r
43 Content-Type: text/plain; charset=us-ascii
\r
44 X-BeenThere: notmuch@notmuchmail.org
\r
45 X-Mailman-Version: 2.1.13
\r
47 List-Id: "Use and development of the notmuch mail system."
\r
48 <notmuch.notmuchmail.org>
\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
52 List-Post: <mailto:notmuch@notmuchmail.org>
\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
56 X-List-Received-Date: Wed, 18 Jan 2012 10:05:00 -0000
\r
58 On Mon, 16 Jan 2012 17:03:44 +0000, David Edmondson <dme@dme.org> wrote:
\r
59 > On Mon, 16 Jan 2012 17:46:55 +0100, Pieter Praet <pieter@praet.org> wrote:
\r
60 > > Make `notmuch-cycle-notmuch-buffers' more Lispy and merge into `notmuch',
\r
61 > > eliminating the need to hog yet another keybind.
\r
63 > > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
64 > > index ef4dcc7..539b3a0 100644
\r
65 > > --- a/emacs/notmuch.el
\r
66 > > +++ b/emacs/notmuch.el
\r
67 > > @@ -1067,7 +1067,20 @@ current search results AND that are tagged with the given tag."
\r
68 > > (defun notmuch ()
\r
69 > > "Run notmuch and display saved searches, known tags, etc."
\r
71 > > - (notmuch-hello))
\r
72 > > + (let* ((old-buffer (current-buffer))
\r
73 > > + (interesting-buffers
\r
74 > > + (delq nil (mapcar (lambda (b)
\r
75 > > + (if (notmuch-interesting-buffer b) b))
\r
76 > > + (buffer-list))))
\r
77 > > + (next-buffer (first
\r
78 > > + (delq nil (mapcar (lambda (b)
\r
79 > > + (unless (eq old-buffer b) b))
\r
80 > > + interesting-buffers)))))
\r
82 > This feels _less_ lispy. [...]
\r
84 True. I simply re-implemented `delete-if-not' in order to
\r
85 prevent having to require the `cl' package at runtime.
\r
86 (why on Earth isn't there an equivalent function in plain Elisp ?!?)
\r
88 $ sed -e "s/C\?Lisp\(y\|'ier\)/Elispy/" $COMMIT_MSG
\r
91 > [...] Any occurrences of '(delq nil ...)' strike me
\r
94 How so? Lacking a flexible way to conditionally remove elements from a
\r
95 list (that doesn't require the `cl' package in some way or another),
\r
96 a combination of `mapcar' and `delq' seemed like the easiest approach.
\r
98 (AFAIK; Please correct me if (when) I'm wrong!)
\r
101 > [...] What's wrong with '(loop ... collect ...)'?
\r
104 Nothing at all. I was fixing my own patch [1] without resorting to
\r
105 requiring the `cl' package at runtime :) Would be nice if we could
\r
106 get rid of the compile-time dependency as well, though.
\r
108 Fresh patch to that effect follows.
\r
110 Feel free to disregard it, just bikesheddin'...
\r
113 > > + (if next-buffer
\r
115 > > + (switch-to-buffer next-buffer)
\r
116 > > + (bury-buffer old-buffer))
\r
117 > > + (notmuch-hello))))
\r
119 > Integrating with `notmuch' is fine with me.
\r
127 [1] id:"1326710551-23122-1-git-send-email-pieter@praet.org"
\r