Re: [PATCH 1/2] Add Google Inc. to AUTHORS as a contributor.
[notmuch-archives.git] / 88 / 242ecab39598764bb519be3f8297df0f3259c9
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 1B609429E35\r
6         for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 13:10:34 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \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 ZQnc4cBMorXM for <notmuch@notmuchmail.org>;\r
16         Mon, 16 Jan 2012 13:10:33 -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  351DF431FD4    for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 13:10:33 -0800\r
21  (PST)\r
22 Received: by eekd41 with SMTP id d41so945606eek.26\r
23         for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 13:10:32 -0800 (PST)\r
24 Received: by 10.213.28.130 with SMTP id m2mr3315274ebc.104.1326748231808;\r
25         Mon, 16 Jan 2012 13:10:31 -0800 (PST)\r
26 Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi.\r
27         [80.220.92.23])\r
28         by mx.google.com with ESMTPS id b49sm76948193eec.9.2012.01.16.13.10.29\r
29         (version=SSLv3 cipher=OTHER); Mon, 16 Jan 2012 13:10:30 -0800 (PST)\r
30 From: Jani Nikula <jani@nikula.org>\r
31 To: Pieter Praet <pieter@praet.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: <1326732415-21894-1-git-send-email-pieter@praet.org>\r
36 References: <87r4yza95m.fsf@praet.org>\r
37         <1326732415-21894-1-git-send-email-pieter@praet.org>\r
38 User-Agent: Notmuch/0.11+76~g1de742d (http://notmuchmail.org) Emacs/23.3.1\r
39         (i686-pc-linux-gnu)\r
40 Date: Mon, 16 Jan 2012 23:10:27 +0200\r
41 Message-ID: <87ehuzl5fg.fsf@nikula.org>\r
42 MIME-Version: 1.0\r
43 Content-Type: text/plain; charset=us-ascii\r
44 Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
45 X-BeenThere: notmuch@notmuchmail.org\r
46 X-Mailman-Version: 2.1.13\r
47 Precedence: list\r
48 List-Id: "Use and development of the notmuch mail system."\r
49         <notmuch.notmuchmail.org>\r
50 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
52 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
53 List-Post: <mailto:notmuch@notmuchmail.org>\r
54 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
55 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
57 X-List-Received-Date: Mon, 16 Jan 2012 21:10:34 -0000\r
58 \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
62 \r
63 What does "merge" mean here? Will it still be possible for me to hit one\r
64 key to unconditionally get to notmuch-hello, and another to cycle\r
65 through the buffers? I wouldn't want to lose that ability.\r
66 \r
67 > ---\r
68 >  emacs/notmuch.el |   40 ++++++++++++++--------------------------\r
69 >  1 files changed, 14 insertions(+), 26 deletions(-)\r
70\r
71 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
72 > index ef4dcc7..539b3a0 100644\r
73 > --- a/emacs/notmuch.el\r
74 > +++ b/emacs/notmuch.el\r
75 > @@ -1067,7 +1067,20 @@ current search results AND that are tagged with the given tag."\r
76 >  (defun notmuch ()\r
77 >    "Run notmuch and display saved searches, known tags, etc."\r
78 >    (interactive)\r
79 > -  (notmuch-hello))\r
80 > +  (let* ((old-buffer (current-buffer))\r
81 > +      (interesting-buffers\r
82 > +       (delq nil (mapcar (lambda (b)\r
83 > +                           (if (notmuch-interesting-buffer b) b))\r
84 > +                         (buffer-list))))\r
85 > +      (next-buffer (first\r
86 > +       (delq nil (mapcar (lambda (b)\r
87 > +                           (unless (eq old-buffer b) b))\r
88 > +                         interesting-buffers)))))\r
89 > +    (if next-buffer\r
90 > +     (progn\r
91 > +       (switch-to-buffer next-buffer)\r
92 > +       (bury-buffer old-buffer))\r
93 > +      (notmuch-hello))))\r
94 \r
95 notmuch-cycle-notmuch-buffers pretty much explains in the name what it\r
96 does, but additionally it has documentation, and explanatory\r
97 comments. Please don't drop those.\r
98 \r
99 BR,\r
100 Jani\r
101 \r
102 \r
103 \r
104 >  \r
105 >  (defun notmuch-interesting-buffer (b)\r
106 >    "Is the current buffer of interest to a notmuch user?"\r
107 > @@ -1078,31 +1091,6 @@ current search results AND that are tagged with the given tag."\r
108 >                      message-mode))))\r
109 >  \r
110 >  ;;;###autoload\r
111 > -(defun notmuch-cycle-notmuch-buffers ()\r
112 > -  "Cycle through any existing notmuch buffers (search, show or hello).\r
113 > -\r
114 > -If the current buffer is the only notmuch buffer, bury it. If no\r
115 > -notmuch buffers exist, run `notmuch'."\r
116 > -  (interactive)\r
117 > -\r
118 > -  (let (start first)\r
119 > -    ;; If the current buffer is a notmuch buffer, remember it and then\r
120 > -    ;; bury it.\r
121 > -    (when (notmuch-interesting-buffer (current-buffer))\r
122 > -      (setq start (current-buffer))\r
123 > -      (bury-buffer))\r
124 > -\r
125 > -    ;; Find the first notmuch buffer.\r
126 > -    (setq first (loop for buffer in (buffer-list)\r
127 > -                  if (notmuch-interesting-buffer buffer)\r
128 > -                  return buffer))\r
129 > -\r
130 > -    (if first\r
131 > -     ;; If the first one we found is any other than the starting\r
132 > -     ;; buffer, switch to it.\r
133 > -     (unless (eq first start)\r
134 > -       (switch-to-buffer first))\r
135 > -      (notmuch))))\r
136 >  \r
137 >  (setq mail-user-agent 'notmuch-user-agent)\r
138 >  \r
139 > -- \r
140 > 1.7.8.1\r
141\r
142 > _______________________________________________\r
143 > notmuch mailing list\r
144 > notmuch@notmuchmail.org\r
145 > http://notmuchmail.org/mailman/listinfo/notmuch\r