Re: [PATCH] emacs: add missing paren to fix defun in notmuch-address.el.
[notmuch-archives.git] / 28 / 4d9b2d1bf3debc019c51418f5e8bf417f1a1ae
1 Return-Path: <dmitry.kurochkin@gmail.com>\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 A72C0431FD0\r
6         for <notmuch@notmuchmail.org>; Mon, 11 Jul 2011 02:55:32 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id 0KTfNzilJupv for <notmuch@notmuchmail.org>;\r
17         Mon, 11 Jul 2011 02:55:31 -0700 (PDT)\r
18 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
19         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 79CBA431FB6\r
22         for <notmuch@notmuchmail.org>; Mon, 11 Jul 2011 02:55:31 -0700 (PDT)\r
23 Received: by bwg12 with SMTP id 12so3551413bwg.26\r
24         for <notmuch@notmuchmail.org>; Mon, 11 Jul 2011 02:55:30 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type;\r
28         bh=tubY19e63EfhvECg+QrXzSWfM1SkRwSX55FfwfdGbRc=;\r
29         b=b7QMF4Ag8Vvep0+AXqDQROWyiEbURgHu8+uMY3Rog492/BxNo5D301is9JP0nW1OGy\r
30         Ke9vQzwNcVLqKYHUJmZ9dQv00d825/W+K2/23SNpqoxInyGlALIXWocgk2K5MZqJrcEj\r
31         xbo1U58Yms10WsAf3II0RHwmkTnRP+pUbr0Ew=\r
32 Received: by 10.204.144.194 with SMTP id a2mr2467472bkv.93.1310378130098;\r
33         Mon, 11 Jul 2011 02:55:30 -0700 (PDT)\r
34 Received: from localhost ([91.144.186.21])\r
35         by mx.google.com with ESMTPS id o3sm976584bka.33.2011.07.11.02.55.28\r
36         (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Mon, 11 Jul 2011 02:55:29 -0700 (PDT)\r
38 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
39 To: Felix Geller <fgeller@gmail.com>, notmuch@notmuchmail.org\r
40 Subject: Re: [PATCH] Emacs: Add variable to toggle message indentation in a\r
41         thread\r
42 In-Reply-To: <m2aaclkw46.fsf@gmail.com>\r
43 References: <m2r55xi4yr.fsf@gmail.com> <87mxgl19n3.fsf@gmail.com>\r
44         <m2aaclkw46.fsf@gmail.com>\r
45 User-Agent: Notmuch/0.5-321-g41686e2 (http://notmuchmail.org) Emacs/23.3.1\r
46         (x86_64-pc-linux-gnu)\r
47 Date: Mon, 11 Jul 2011 13:55:24 +0400\r
48 Message-ID: <877h7p16r7.fsf@gmail.com>\r
49 MIME-Version: 1.0\r
50 Content-Type: text/plain; charset=us-ascii\r
51 X-BeenThere: notmuch@notmuchmail.org\r
52 X-Mailman-Version: 2.1.13\r
53 Precedence: list\r
54 List-Id: "Use and development of the notmuch mail system."\r
55         <notmuch.notmuchmail.org>\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
59 List-Post: <mailto:notmuch@notmuchmail.org>\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
63 X-List-Received-Date: Mon, 11 Jul 2011 09:55:32 -0000\r
64 \r
65 On Mon, 11 Jul 2011 11:24:57 +0200, Felix Geller <fgeller@gmail.com> wrote:\r
66 > Hi Dmitry,\r
67\r
68 > thank you for the comments. I included an updated patch that also\r
69 > includes Daniel's comment regarding the default value. \r
70\r
71 \r
72 Another thing that would be nice to have is a test for this feature.\r
73 \r
74 Regards,\r
75   Dmitry\r
76 \r
77 > I didn't change the "when" though--not because of personal reasons\r
78 > ;)--but because it is used for determining indentation of multi-parts.\r
79\r
80\r
81 > Cheers,\r
82 > Felix\r
83\r
84\r
85\r
86 > On Mon, 11 Jul 2011 12:53:04 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
87 > > Hi Felix.\r
88 > > \r
89 > > On Mon, 11 Jul 2011 10:42:04 +0200, Felix Geller <fgeller@gmail.com> wrote:\r
90 > > > Hi,\r
91 > > > \r
92 > > > I added a variable to toggle message indentation in Emacs.\r
93 > > > \r
94 > > > Please let me know what you think.\r
95 > > > \r
96 > > \r
97 > > I like the change.  Though I do not think I would use it without\r
98 > > chronological sorting.\r
99 > > \r
100 > > Comments on the code below.\r
101 > > \r
102 > > Regards,\r
103 > >   Dmitry\r
104 > > \r
105 > > > \r
106 > > > Cheers,\r
107 > > > Felix\r
108 > > > \r
109 > > > \r
110 > > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
111 > > > index a433dec..8101c27 100644\r
112 > > > --- a/emacs/notmuch-show.el\r
113 > > > +++ b/emacs/notmuch-show.el\r
114 > > > @@ -90,6 +90,11 @@ any given message."\r
115 > > >    :group 'notmuch\r
116 > > >    :type 'boolean)\r
117 > > >  \r
118 > > > +(defcustom notmuch-show-indent-messages-in-thread nil\r
119 > > > +  "Should the messages in a thread be indented according to their respective depth in the thread?"\r
120 > > \r
121 > > This line is too long and should be split.\r
122 > > \r
123 > > > +  :group 'notmuch\r
124 > > > +  :type 'boolean)\r
125 > > > +\r
126 > > >  (defcustom notmuch-show-indent-multipart nil\r
127 > > >    "Should the sub-parts of a multipart/* part be indented?"\r
128 > > >    ;; dme: Not sure which is a good default.\r
129 > > > @@ -237,7 +242,9 @@ unchanged ADDRESS if parsing fails."\r
130 > > >    "Insert a notmuch style headerline based on HEADERS for a\r
131 > > >  message at DEPTH in the current thread."\r
132 > > >    (let ((start (point)))\r
133 > > > -    (insert (notmuch-show-spaces-n depth)\r
134 > > > +    (insert (if notmuch-show-indent-messages-in-thread\r
135 > > > +         (notmuch-show-spaces-n depth)\r
136 > > > +       "")\r
137 > > \r
138 > > (if notmuch-show-indent-messages-in-thread\r
139 > >     (insert (notmuch-show-spaces-n depth)))\r
140 > > \r
141 > > Is cleaner and avoids useless empty string insert.\r
142 > > \r
143 > > >       (notmuch-show-clean-address (plist-get headers :From))\r
144 > > >       " ("\r
145 > > >       date\r
146 > > > @@ -733,7 +740,8 @@ current buffer, if possible."\r
147 > > >      (setq content-end (point-marker))\r
148 > > >  \r
149 > > >      ;; Indent according to the depth in the thread.\r
150 > > > -    (indent-rigidly content-start content-end depth)\r
151 > > > +    (when notmuch-show-indent-messages-in-thread\r
152 > > > +      (indent-rigidly content-start content-end depth))\r
153 > > \r
154 > > Not a big deal, but I would prefer `if' instead of `when' here.\r
155 > > \r
156 > > Regards,\r
157 > >   Dmitry\r
158 > > \r
159 > > >  \r
160 > > >      (setq message-end (point-max-marker))\r
161 > > >  \r
162 > > > _______________________________________________\r
163 > > > notmuch mailing list\r
164 > > > notmuch@notmuchmail.org\r
165 > > > http://notmuchmail.org/mailman/listinfo/notmuch\r
166\r
167\r
168 > commit f90fafdc0545a825ea4b69db5e51c2e866a4ff5e\r
169 > Author: Felix Geller <fgeller@gmail.com>\r
170 > Date:   Mon Jul 11 10:39:00 2011 +0200\r
171\r
172 >     Added a variable to toggle message indentation for thread view in emacs.\r
173 >      - includes adjustments according to comments from ML\r
174\r
175 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
176 > index a433dec..1834066 100644\r
177 > --- a/emacs/notmuch-show.el\r
178 > +++ b/emacs/notmuch-show.el\r
179 > @@ -90,6 +90,11 @@ any given message."\r
180 >    :group 'notmuch\r
181 >    :type 'boolean)\r
182 >  \r
183 > +(defcustom notmuch-show-indent-messages-in-thread t\r
184 > +  "Should messages be indented according to their depth in a thread?"\r
185 > +  :group 'notmuch\r
186 > +  :type 'boolean)\r
187 > +\r
188 >  (defcustom notmuch-show-indent-multipart nil\r
189 >    "Should the sub-parts of a multipart/* part be indented?"\r
190 >    ;; dme: Not sure which is a good default.\r
191 > @@ -237,8 +242,9 @@ unchanged ADDRESS if parsing fails."\r
192 >    "Insert a notmuch style headerline based on HEADERS for a\r
193 >  message at DEPTH in the current thread."\r
194 >    (let ((start (point)))\r
195 > -    (insert (notmuch-show-spaces-n depth)\r
196 > -         (notmuch-show-clean-address (plist-get headers :From))\r
197 > +    (when notmuch-show-indent-messages-in-thread\r
198 > +      (insert (notmuch-show-spaces-n depth)))\r
199 > +    (insert (notmuch-show-clean-address (plist-get headers :From))\r
200 >           " ("\r
201 >           date\r
202 >           ") ("\r
203 > @@ -733,7 +739,8 @@ current buffer, if possible."\r
204 >      (setq content-end (point-marker))\r
205 >  \r
206 >      ;; Indent according to the depth in the thread.\r
207 > -    (indent-rigidly content-start content-end depth)\r
208 > +    (when notmuch-show-indent-messages-in-thread\r
209 > +      (indent-rigidly content-start content-end depth))\r
210 >  \r
211 >      (setq message-end (point-max-marker))\r
212 >  \r