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 75BE6431E64
\r
6 for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 02:44:26 -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 kktGsQ8Rm3Io for <notmuch@notmuchmail.org>;
\r
16 Mon, 16 Jan 2012 02:44:26 -0800 (PST)
\r
17 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com
\r
18 [209.85.212.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 D43B2431FC0
\r
21 for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 02:44:25 -0800 (PST)
\r
22 Received: by wibhr12 with SMTP id hr12so2269757wib.26
\r
23 for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 02:44:24 -0800 (PST)
\r
24 Received: by 10.180.85.4 with SMTP id d4mr18522588wiz.0.1326710664720;
\r
25 Mon, 16 Jan 2012 02:44:24 -0800 (PST)
\r
26 Received: from localhost ([109.131.75.86])
\r
27 by mx.google.com with ESMTPS id fv6sm33219738wib.8.2012.01.16.02.44.24
\r
28 (version=TLSv1/SSLv3 cipher=OTHER);
\r
29 Mon, 16 Jan 2012 02:44:24 -0800 (PST)
\r
30 From: Pieter Praet <pieter@praet.org>
\r
31 To: David Edmondson <dme@dme.org>,
\r
32 Austin Clements <amdragon@MIT.EDU>
\r
33 Subject: [PATCH] [RFC] emacs: merge overhauled `notmuch-cycle-notmuch-buffers'
\r
35 Date: Mon, 16 Jan 2012 11:42:31 +0100
\r
36 Message-Id: <1326710551-23122-1-git-send-email-pieter@praet.org>
\r
37 X-Mailer: git-send-email 1.7.8.1
\r
38 In-Reply-To: <cunpqek597g.fsf@hotblack-desiato.hh.sledj.net>
\r
39 References: <cunpqek597g.fsf@hotblack-desiato.hh.sledj.net>
\r
40 Cc: Notmuch Mail <notmuch@notmuchmail.org>
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Mon, 16 Jan 2012 10:44:26 -0000
\r
55 CLisp'ier version of `notmuch-cycle-notmuch-buffers', merged into `notmuch',
\r
56 eliminating the need to hog yet another keybind.
\r
58 FYI: causes 2 compile warnings due to requiring the cl package at runtime.
\r
60 emacs/notmuch.el | 34 ++++++++--------------------------
\r
61 1 files changed, 8 insertions(+), 26 deletions(-)
\r
63 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
64 index ef4dcc7..60ab0b2 100644
\r
65 --- a/emacs/notmuch.el
\r
66 +++ b/emacs/notmuch.el
\r
67 @@ -1067,7 +1067,14 @@ current search results AND that are tagged with the given tag."
\r
69 "Run notmuch and display saved searches, known tags, etc."
\r
72 + (let* ((old-buffer (current-buffer))
\r
73 + (interesting-buffers (remove-if-not #'notmuch-interesting-buffer (buffer-list)))
\r
74 + (next-buffer (first (member-if-not #'(lambda (b) (eq old-buffer b)) interesting-buffers))))
\r
77 + (switch-to-buffer next-buffer)
\r
78 + (bury-buffer old-buffer))
\r
79 + (notmuch-hello))))
\r
81 (defun notmuch-interesting-buffer (b)
\r
82 "Is the current buffer of interest to a notmuch user?"
\r
83 @@ -1078,31 +1085,6 @@ current search results AND that are tagged with the given tag."
\r
87 -(defun notmuch-cycle-notmuch-buffers ()
\r
88 - "Cycle through any existing notmuch buffers (search, show or hello).
\r
90 -If the current buffer is the only notmuch buffer, bury it. If no
\r
91 -notmuch buffers exist, run `notmuch'."
\r
94 - (let (start first)
\r
95 - ;; If the current buffer is a notmuch buffer, remember it and then
\r
97 - (when (notmuch-interesting-buffer (current-buffer))
\r
98 - (setq start (current-buffer))
\r
101 - ;; Find the first notmuch buffer.
\r
102 - (setq first (loop for buffer in (buffer-list)
\r
103 - if (notmuch-interesting-buffer buffer)
\r
107 - ;; If the first one we found is any other than the starting
\r
108 - ;; buffer, switch to it.
\r
109 - (unless (eq first start)
\r
110 - (switch-to-buffer first))
\r
113 (setq mail-user-agent 'notmuch-user-agent)
\r