[PATCH 2/3] command-line-arguments: support keyword arguments with default value
[notmuch-archives.git] / 20 / 8ab8eee4b5c2481c8a69670a155607f3f01c03
1 Return-Path: <dme@dme.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 9BCFB431E84\r
6         for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 22:35:40 -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 5U4TETtJOHiL for <notmuch@notmuchmail.org>;\r
16         Tue, 24 Jan 2012 22:35:38 -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 54A45431FB6\r
21         for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 22:35:38 -0800 (PST)\r
22 Received: by werb10 with SMTP id b10so4131238wer.26\r
23         for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 22:35:37 -0800 (PST)\r
24 Received: by 10.216.133.29 with SMTP id p29mr6518400wei.49.1327473337018;\r
25         Tue, 24 Jan 2012 22:35:37 -0800 (PST)\r
26 Received: from hotblack-desiato.hh.sledj.net\r
27         (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])\r
28         by mx.google.com with ESMTPS id m8sm39153733wia.11.2012.01.24.22.35.35\r
29         (version=TLSv1/SSLv3 cipher=OTHER);\r
30         Tue, 24 Jan 2012 22:35:35 -0800 (PST)\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
32         id A77B69FD47; Wed, 25 Jan 2012 06:35:33 +0000 (GMT)\r
33 To: Pieter Praet <pieter@praet.org>, Notmuch Mail <notmuch@notmuchmail.org>\r
34 Subject: Re: [PATCH] emacs: make `notmuch-show-open-or-close-all' toggle\r
35         visibility\r
36 In-Reply-To: <1327469139-1968-1-git-send-email-pieter@praet.org>\r
37 References: <1327469139-1968-1-git-send-email-pieter@praet.org>\r
38 User-Agent: Notmuch/0.11+105~g08b3b0f (http://notmuchmail.org) Emacs/24.0.92.1\r
39         (x86_64-pc-linux-gnu)\r
40 From: David Edmondson <dme@dme.org>\r
41 Date: Wed, 25 Jan 2012 06:35:33 +0000\r
42 Message-ID: <cunhazknvbe.fsf@hotblack-desiato.hh.sledj.net>\r
43 MIME-Version: 1.0\r
44 Content-Type: multipart/signed; boundary="=-=-=";\r
45         micalg=pgp-sha1; protocol="application/pgp-signature"\r
46 X-Gm-Message-State:\r
47  ALoCoQlmxSwSucFsY45DVndUHqFJT1zlFxKKpAucd4tyGFLA/vONDrLanI4bP5YCPAmet+Fzdd79\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.13\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Wed, 25 Jan 2012 06:35:40 -0000\r
61 \r
62 --=-=-=\r
63 Content-Type: text/plain\r
64 Content-Transfer-Encoding: quoted-printable\r
65 \r
66 On Wed, 25 Jan 2012 06:25:39 +0100, Pieter Praet <pieter@praet.org> wrote:\r
67 > * emacs/notmuch-show.el (notmuch-show-open-or-close-all):\r
68 >   Rename to `notmuch-show-toggle-all-messages', and make it toggle\r
69 >   visibility of all messages based on the visibility of the current\r
70 >   message, instead of setting visibility based on whether or not a\r
71 >   prefix arg was supplied.\r
72 >=20\r
73 > Same functionality, less effort (reaching for 'C-u' is a pain)...\r
74 \r
75 =2D1.\r
76 \r
77 The behaviour you've provided is not what I want, from two perspectives:\r
78         - currently it's clear what will happen when I use M-RET or\r
79           C-uM-RET without me having to think about whether the cursor\r
80           is over an open message,\r
81         - often I'll be reading an open message and I want to open all\r
82           of the rest to look at some context. That's a little more\r
83           awkward after this change.\r
84 >=20\r
85 > ---\r
86 >  emacs/notmuch-show.el |   22 ++++++++++++----------\r
87 >  1 files changed, 12 insertions(+), 10 deletions(-)\r
88 >=20\r
89 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
90 > index e6a5b31..2d17f74 100644\r
91 > --- a/emacs/notmuch-show.el\r
92 > +++ b/emacs/notmuch-show.el\r
93 > @@ -1050,8 +1050,8 @@ thread id.  If a prefix is given, crypto processing=\r
94  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
102 >       map)\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
107 >=20=20\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
115 >    (interactive)\r
116 > -  (save-excursion\r
117 > -    (goto-char (point-min))\r
118 > -    (loop do (notmuch-show-message-visible (notmuch-show-get-message-pro=\r
119 perties)\r
120 > -                                        (not current-prefix-arg))\r
121 > -       until (not (notmuch-show-goto-message-next))))\r
122 > +  (let ((toggle (notmuch-show-message-visible-p)))\r
123 > +    (save-excursion\r
124 > +      (goto-char (point-min))\r
125 > +      (loop do (notmuch-show-message-visible\r
126 > +             (notmuch-show-get-message-properties)\r
127 > +             (not toggle))\r
128 > +         until (not (notmuch-show-goto-message-next)))))\r
129 > +  (recenter-top-bottom 1)\r
130 >    (force-window-update))\r
131 >=20=20\r
132 >  (defun notmuch-show-next-button ()\r
133 > --=20\r
134 > 1.7.8.1\r
135 >=20\r
136 > _______________________________________________\r
137 > notmuch mailing list\r
138 > notmuch@notmuchmail.org\r
139 > http://notmuchmail.org/mailman/listinfo/notmuch\r
140 \r
141 --=-=-=\r
142 Content-Type: application/pgp-signature\r
143 \r
144 -----BEGIN PGP SIGNATURE-----\r
145 Version: GnuPG v1.4.11 (GNU/Linux)\r
146 \r
147 iEYEARECAAYFAk8forUACgkQaezQq/BJZRY4EQCfQ5oPOeJnXidE2yuPAGqVXtWv\r
148 I4cAn2chJfpZrK/NolUMkHcttW6EHyfx\r
149 =eyO+\r
150 -----END PGP SIGNATURE-----\r
151 --=-=-=--\r