Re: notmuch.el: controlling what does and doesn't get expanded in searches
[notmuch-archives.git] / 26 / 651e9815d84a42cb2c9f2ffee59d0d25771d45
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 6335B431FD0\r
6         for <notmuch@notmuchmail.org>; Mon, 11 Jul 2011 01:53:14 -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 62vTEYGwPbzy for <notmuch@notmuchmail.org>;\r
17         Mon, 11 Jul 2011 01:53:13 -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 47B39431FB6\r
22         for <notmuch@notmuchmail.org>; Mon, 11 Jul 2011 01:53:12 -0700 (PDT)\r
23 Received: by bwg12 with SMTP id 12so3511863bwg.26\r
24         for <notmuch@notmuchmail.org>; Mon, 11 Jul 2011 01:53:11 -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=S0gTsvT7nYEVuMvfxXqV1aPRyOdMQmYmMnig0qCaFHA=;\r
29         b=d2OUqL+GuI5d/A74ZqUV5QXi5Id+41pFyeNTU/gLtI/NkUlL5IniZ25Y9mJStYCIh7\r
30         POvDEetwjgpbUnKRTLlKlAgxtBeur2+0EJnOUrgu9cBr6jx92WhxwxjRMCs8w7K1pIjg\r
31         tCbbWEX8sVj9EhHNIpLZIFjD8YoUH+7jq2uNM=\r
32 Received: by 10.205.65.198 with SMTP id xn6mr1524707bkb.359.1310374390155;\r
33         Mon, 11 Jul 2011 01:53:10 -0700 (PDT)\r
34 Received: from localhost ([91.144.186.21])\r
35         by mx.google.com with ESMTPS id v6sm956079bkd.22.2011.07.11.01.53.08\r
36         (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Mon, 11 Jul 2011 01:53:09 -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: <m2r55xi4yr.fsf@gmail.com>\r
43 References: <m2r55xi4yr.fsf@gmail.com>\r
44 User-Agent: Notmuch/0.5-321-g41686e2 (http://notmuchmail.org) Emacs/23.3.1\r
45         (x86_64-pc-linux-gnu)\r
46 Date: Mon, 11 Jul 2011 12:53:04 +0400\r
47 Message-ID: <87mxgl19n3.fsf@gmail.com>\r
48 MIME-Version: 1.0\r
49 Content-Type: text/plain; charset=us-ascii\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Mon, 11 Jul 2011 08:53:14 -0000\r
63 \r
64 Hi Felix.\r
65 \r
66 On Mon, 11 Jul 2011 10:42:04 +0200, Felix Geller <fgeller@gmail.com> wrote:\r
67 > Hi,\r
68\r
69 > I added a variable to toggle message indentation in Emacs.\r
70\r
71 > Please let me know what you think.\r
72\r
73 \r
74 I like the change.  Though I do not think I would use it without\r
75 chronological sorting.\r
76 \r
77 Comments on the code below.\r
78 \r
79 Regards,\r
80   Dmitry\r
81 \r
82\r
83 > Cheers,\r
84 > Felix\r
85\r
86\r
87 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
88 > index a433dec..8101c27 100644\r
89 > --- a/emacs/notmuch-show.el\r
90 > +++ b/emacs/notmuch-show.el\r
91 > @@ -90,6 +90,11 @@ any given message."\r
92 >    :group 'notmuch\r
93 >    :type 'boolean)\r
94 >  \r
95 > +(defcustom notmuch-show-indent-messages-in-thread nil\r
96 > +  "Should the messages in a thread be indented according to their respective depth in the thread?"\r
97 \r
98 This line is too long and should be split.\r
99 \r
100 > +  :group 'notmuch\r
101 > +  :type 'boolean)\r
102 > +\r
103 >  (defcustom notmuch-show-indent-multipart nil\r
104 >    "Should the sub-parts of a multipart/* part be indented?"\r
105 >    ;; dme: Not sure which is a good default.\r
106 > @@ -237,7 +242,9 @@ unchanged ADDRESS if parsing fails."\r
107 >    "Insert a notmuch style headerline based on HEADERS for a\r
108 >  message at DEPTH in the current thread."\r
109 >    (let ((start (point)))\r
110 > -    (insert (notmuch-show-spaces-n depth)\r
111 > +    (insert (if notmuch-show-indent-messages-in-thread\r
112 > +             (notmuch-show-spaces-n depth)\r
113 > +           "")\r
114 \r
115 (if notmuch-show-indent-messages-in-thread\r
116     (insert (notmuch-show-spaces-n depth)))\r
117 \r
118 Is cleaner and avoids useless empty string insert.\r
119 \r
120 >           (notmuch-show-clean-address (plist-get headers :From))\r
121 >           " ("\r
122 >           date\r
123 > @@ -733,7 +740,8 @@ current buffer, if possible."\r
124 >      (setq content-end (point-marker))\r
125 >  \r
126 >      ;; Indent according to the depth in the thread.\r
127 > -    (indent-rigidly content-start content-end depth)\r
128 > +    (when notmuch-show-indent-messages-in-thread\r
129 > +      (indent-rigidly content-start content-end depth))\r
130 \r
131 Not a big deal, but I would prefer `if' instead of `when' here.\r
132 \r
133 Regards,\r
134   Dmitry\r
135 \r
136 >  \r
137 >      (setq message-end (point-max-marker))\r
138 >  \r
139 > _______________________________________________\r
140 > notmuch mailing list\r
141 > notmuch@notmuchmail.org\r
142 > http://notmuchmail.org/mailman/listinfo/notmuch\r