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 479BA431FAF
\r
6 for <notmuch@notmuchmail.org>; Thu, 26 Jan 2012 05:04:15 -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 tHAHjek6Ofto for <notmuch@notmuchmail.org>;
\r
16 Thu, 26 Jan 2012 05:04:14 -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 D0636431FAE
\r
21 for <notmuch@notmuchmail.org>; Thu, 26 Jan 2012 05:04:13 -0800 (PST)
\r
22 Received: by wibhi8 with SMTP id hi8so402874wib.26
\r
23 for <notmuch@notmuchmail.org>; Thu, 26 Jan 2012 05:04:11 -0800 (PST)
\r
24 Received: by 10.180.87.8 with SMTP id t8mr3990787wiz.15.1327583051377;
\r
25 Thu, 26 Jan 2012 05:04:11 -0800 (PST)
\r
26 Received: from localhost ([109.131.116.159])
\r
27 by mx.google.com with ESMTPS id cb8sm5340165wib.0.2012.01.26.05.04.10
\r
28 (version=TLSv1/SSLv3 cipher=OTHER);
\r
29 Thu, 26 Jan 2012 05:04:10 -0800 (PST)
\r
30 From: Pieter Praet <pieter@praet.org>
\r
31 To: David Edmondson <dme@dme.org>, Notmuch Mail <notmuch@notmuchmail.org>
\r
32 Subject: Re: [PATCH] emacs: make `notmuch-show-open-or-close-all' toggle
\r
34 In-Reply-To: <cunhazknvbe.fsf@hotblack-desiato.hh.sledj.net>
\r
35 References: <1327469139-1968-1-git-send-email-pieter@praet.org>
\r
36 <cunhazknvbe.fsf@hotblack-desiato.hh.sledj.net>
\r
37 User-Agent: Notmuch/0.11+132~ga81001f (http://notmuchmail.org) Emacs/23.3.1
\r
38 (x86_64-unknown-linux-gnu)
\r
39 Date: Thu, 26 Jan 2012 14:02:15 +0100
\r
40 Message-ID: <87vcnyvcq0.fsf@praet.org>
\r
42 Content-Type: text/plain; charset=us-ascii
\r
43 X-BeenThere: notmuch@notmuchmail.org
\r
44 X-Mailman-Version: 2.1.13
\r
46 List-Id: "Use and development of the notmuch mail system."
\r
47 <notmuch.notmuchmail.org>
\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
51 List-Post: <mailto:notmuch@notmuchmail.org>
\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
55 X-List-Received-Date: Thu, 26 Jan 2012 13:04:15 -0000
\r
57 On Wed, 25 Jan 2012 06:35:33 +0000, David Edmondson <dme@dme.org> wrote:
\r
58 > On Wed, 25 Jan 2012 06:25:39 +0100, Pieter Praet <pieter@praet.org> wrote:
\r
59 > > * emacs/notmuch-show.el (notmuch-show-open-or-close-all):
\r
60 > > Rename to `notmuch-show-toggle-all-messages', and make it toggle
\r
61 > > visibility of all messages based on the visibility of the current
\r
62 > > message, instead of setting visibility based on whether or not a
\r
63 > > prefix arg was supplied.
\r
65 > > Same functionality, less effort (reaching for 'C-u' is a pain)...
\r
69 > The behaviour you've provided is not what I want, from two perspectives:
\r
70 > - currently it's clear what will happen when I use M-RET or
\r
71 > C-uM-RET without me having to think about whether the cursor
\r
72 > is over an open message,
\r
73 > - often I'll be reading an open message and I want to open all
\r
74 > of the rest to look at some context. That's a little more
\r
75 > awkward after this change.
\r
77 I may be missing something, but wouldn't both issues be solved by simply
\r
78 pressing M-RET a second time? I've been using this for a little while
\r
79 now, and IMO it makes navigating through long and diverging threads a lot
\r
80 faster, much like zooming in/out on an outline.
\r
82 How about if C-u M-RET behaved as usual ?
\r
87 > > emacs/notmuch-show.el | 22 ++++++++++++----------
\r
88 > > 1 files changed, 12 insertions(+), 10 deletions(-)
\r
90 > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
91 > > index e6a5b31..2d17f74 100644
\r
92 > > --- a/emacs/notmuch-show.el
\r
93 > > +++ b/emacs/notmuch-show.el
\r
94 > > @@ -1050,8 +1050,8 @@ thread id. If a prefix is given, crypto processing is toggled."
\r
95 > > (define-key map "p" 'notmuch-show-previous-open-message)
\r
96 > > (define-key map (kbd "DEL") 'notmuch-show-rewind)
\r
97 > > (define-key map " " 'notmuch-show-advance-and-archive)
\r
98 > > - (define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
\r
99 > > (define-key map (kbd "RET") 'notmuch-show-toggle-message)
\r
100 > > + (define-key map (kbd "M-RET") 'notmuch-show-toggle-all-messages)
\r
101 > > (define-key map "#" 'notmuch-show-print-message)
\r
103 > > "Keymap for \"notmuch show\" buffers.")
\r
104 > > @@ -1502,16 +1502,18 @@ the result."
\r
105 > > (not (plist-get props :message-visible))))
\r
106 > > (force-window-update))
\r
108 > > -(defun notmuch-show-open-or-close-all ()
\r
109 > > - "Set the visibility all of the messages in the current thread.
\r
110 > > -By default make all of the messages visible. With a prefix
\r
111 > > -argument, hide all of the messages."
\r
112 > > +(defun notmuch-show-toggle-all-messages ()
\r
113 > > + "Toggle the visibility of all messages in the current thread.
\r
114 > > +If the current message is visible, hide all messages -- and vice versa."
\r
116 > > - (save-excursion
\r
117 > > - (goto-char (point-min))
\r
118 > > - (loop do (notmuch-show-message-visible (notmuch-show-get-message-properties)
\r
119 > > - (not current-prefix-arg))
\r
120 > > - until (not (notmuch-show-goto-message-next))))
\r
121 > > + (let ((toggle (notmuch-show-message-visible-p)))
\r
122 > > + (save-excursion
\r
123 > > + (goto-char (point-min))
\r
124 > > + (loop do (notmuch-show-message-visible
\r
125 > > + (notmuch-show-get-message-properties)
\r
126 > > + (not toggle))
\r
127 > > + until (not (notmuch-show-goto-message-next)))))
\r
128 > > + (recenter-top-bottom 1)
\r
129 > > (force-window-update))
\r
131 > > (defun notmuch-show-next-button ()
\r
135 > > _______________________________________________
\r
136 > > notmuch mailing list
\r
137 > > notmuch@notmuchmail.org
\r
138 > > http://notmuchmail.org/mailman/listinfo/notmuch
\r