Re: Flat search and threaded views
[notmuch-archives.git] / 91 / a76f9941dff1217c0914acf56ac78285667c65
1 Return-Path: <markwalters1009@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 arlo.cworth.org (Postfix) with ESMTP id E71986DE0231\r
6  for <notmuch@notmuchmail.org>; Tue,  9 Feb 2016 14:36:03 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.225\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.225 tagged_above=-999 required=5 tests=[AWL=0.345,\r
12   DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13  FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
14  RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]\r
15  autolearn=disabled\r
16 Received: from arlo.cworth.org ([127.0.0.1])\r
17  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
18  with ESMTP id vWpkkzGE-gZf for <notmuch@notmuchmail.org>;\r
19  Tue,  9 Feb 2016 14:36:01 -0800 (PST)\r
20 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com\r
21  [74.125.82.66]) by arlo.cworth.org (Postfix) with ESMTPS id 75B176DE01D3 for\r
22  <notmuch@notmuchmail.org>; Tue,  9 Feb 2016 14:36:01 -0800 (PST)\r
23 Received: by mail-wm0-f66.google.com with SMTP id c200so528109wme.0\r
24  for <notmuch@notmuchmail.org>; Tue, 09 Feb 2016 14:36:01 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26  h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27  :mime-version:content-type;\r
28  bh=UPVD4E22bC6pyZoFr8O6/msntaRyc7QfhOtp2vcDk1k=;\r
29  b=rCPsD94mYuJAVzpJaBkVEdT/JHHEK1YEjazVFgRtiWg7hIOAlPgtcNOhm5MvgeAiIr\r
30  lBkVYRZY0/luKFq4YeF4Z9x3+qn+GUREWxI81pwhDwH+/Kx1WHJdoAalUSn8QIHfZh+R\r
31  OpdBgTXv7kzaM7C8DW8n6CLEwVhD69otN7NAgndYEnM3oA9D03TBivnD+szCV1aceQc4\r
32  A5SZhyeAlZfasadqd19U+uLLcvkvJv4A3x1ZvlLaLi8IWWgBTlusb0iQCc9S4Vffzf6z\r
33  qZXl9K2I30XiUyQJ9rqnCrQHnYl5jbYdpFhvjkffd5d7QQ8yGwGiKMlvvEgzADQUKeJS\r
34  8+ag==\r
35 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
36  d=1e100.net; s=20130820;\r
37  h=x-gm-message-state:from:to:subject:in-reply-to:references\r
38  :user-agent:date:message-id:mime-version:content-type;\r
39  bh=UPVD4E22bC6pyZoFr8O6/msntaRyc7QfhOtp2vcDk1k=;\r
40  b=bRE/EeGqy2BdVhdWk+XFBPdLdxYAvHhoGDyUq2xroPLXRvTGxZjHZTo22F6Yf2J15t\r
41  Gx7RBeGUE14mGIGBe2pVXafIFtgv2UooDuVSTShnv9JchtMQWRKcK+RCSmdO2Ny6OHBZ\r
42  6KWUkpZFs5PVJRULP1pzTEJ4aVo2awyuDc57n2eJjw2013yJnvjLJWdHUslCH2ZztsJr\r
43  ZitiCFhfGO8VISUNB5fgvt8OH0l7hDZ5BiZKwal5LhKlhdNwiQUkFzfHrXpsAF967LRe\r
44  HL1Ot0HN2dErfAm8qaXesokMJxmIsgBQMnc824UviwS1c+BHK9N7Hq6XWgfLRQaJI8JJ\r
45  m2jg==\r
46 X-Gm-Message-State:\r
47  AG10YOSARhJUkNsQ/lYpBg8xAbMJDxk8pMenJagcE8OZTUddv9PlOAOtXqe9hPNA0fkOkA==\r
48 X-Received: by 10.28.184.137 with SMTP id i131mr7014886wmf.96.1455057360115;\r
49  Tue, 09 Feb 2016 14:36:00 -0800 (PST)\r
50 Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
51  by smtp.gmail.com with ESMTPSA id uo9sm126876wjc.49.2016.02.09.14.35.59\r
52  (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
53  Tue, 09 Feb 2016 14:35:59 -0800 (PST)\r
54 From: Mark Walters <markwalters1009@gmail.com>\r
55 To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
56 Subject: Re: [PATCH v4 6/7] emacs/mua: Let user specify which parts get a\r
57  header in citations.\r
58 In-Reply-To: <m2ziv939o7.fsf@dme.org>\r
59 References: <1446894276-7814-1-git-send-email-markwalters1009@gmail.com>\r
60  <1446894276-7814-7-git-send-email-markwalters1009@gmail.com>\r
61  <m2ziv939o7.fsf@dme.org>\r
62 User-Agent: Notmuch/0.18.1+485~gca076ce (http://notmuchmail.org) Emacs/24.4.1\r
63  (x86_64-pc-linux-gnu)\r
64 Date: Tue, 09 Feb 2016 22:35:58 +0000\r
65 Message-ID: <87twlh5x69.fsf@qmul.ac.uk>\r
66 MIME-Version: 1.0\r
67 Content-Type: text/plain\r
68 X-BeenThere: notmuch@notmuchmail.org\r
69 X-Mailman-Version: 2.1.20\r
70 Precedence: list\r
71 List-Id: "Use and development of the notmuch mail system."\r
72  <notmuch.notmuchmail.org>\r
73 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
74  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
75 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
76 List-Post: <mailto:notmuch@notmuchmail.org>\r
77 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
78 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
79  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
80 X-List-Received-Date: Tue, 09 Feb 2016 22:36:04 -0000\r
81 \r
82 \r
83 On Tue, 09 Feb 2016, David Edmondson <dme@dme.org> wrote:\r
84 > On Sat, Nov 07 2015, Mark Walters wrote:\r
85 >> From: David Edmondson <dme@dme.org>\r
86 >>\r
87 >> Add a customizable function specifying which parts get a header when\r
88 >> replying, and give some sensible possiblities. These are,\r
89 >>\r
90 >> 1) all parts except multipart/*. (Subparts of a multipart part do\r
91 >> receive a header button.)\r
92 >>\r
93 >> 2) only included text/* parts.\r
94 >>\r
95 >> 3) Exactly as in the show buffer.\r
96 >>\r
97 >> 4) None at all. This means the reply contains a mish-mash of all the\r
98 >> original message's parts.\r
99 >> ---\r
100 >>  emacs/notmuch-mua.el  | 30 ++++++++++++++++++++++++++----\r
101 >>  emacs/notmuch-show.el | 13 +++++++++++++\r
102 >>  2 files changed, 39 insertions(+), 4 deletions(-)\r
103 >>\r
104 >> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
105 >> index 2f7abb0..a675f47 100644\r
106 >> --- a/emacs/notmuch-mua.el\r
107 >> +++ b/emacs/notmuch-mua.el\r
108 >> @@ -91,6 +91,23 @@ (defcustom notmuch-mua-cite-function 'message-cite-original\r
109 >>    :link '(custom-manual "(message)Insertion Variables")\r
110 >>    :group 'notmuch-reply)\r
111 >>  \r
112 >> +(defcustom notmuch-mua-reply-insert-header-p-function\r
113 >> +  'notmuch-show-reply-insert-header-p-trimmed\r
114 >> +  "Function to decide which parts get a header when replying.\r
115 >> +\r
116 >> +This function specifies which parts of a mime message with\r
117 >> +mutiple parts get a header."\r
118 >> +  :type '(radio (const :tag "All except multipart/* and hidden parts"\r
119 >> +                           notmuch-show-reply-insert-header-p-trimmed)\r
120 >> +            (const :tag "Only for included text parts"\r
121 >> +                           notmuch-show-reply-insert-header-p-minimal)\r
122 >> +            (const :tag "Exactly as in show view"\r
123 >> +                           notmuch-show-insert-header-p)\r
124 >> +            (const :tag "No part headers"\r
125 >> +                           notmuch-show-reply-insert-header-p-never)\r
126 >> +            (function :tag "Other"))\r
127 >> +  :group 'notmuch-reply)\r
128 >> +\r
129 >\r
130 > These are all functions - should we be `declare-function'ing them, given\r
131 > that they come from elsewhere? Presumably the compiler is not clever\r
132 > enough to complain if we don't.\r
133 \r
134 Hi,\r
135 \r
136 The compiler doesn't seem to complain. But I don't know if we should\r
137 have the declare functions anyway? Any thoughts?\r
138 \r
139 Best wishes\r
140 \r
141 Mark\r
142 \r
143 >\r
144 >>  ;;\r
145 >>  \r
146 >>  (defun notmuch-mua-get-switch-function ()\r
147 >> @@ -221,10 +238,15 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)\r
148 >>      (insert "Date: " date "\n\n")\r
149 >>  \r
150 >>      (insert (with-temp-buffer\r
151 >> -              ;; Don't attempt to clean up messages, excerpt\r
152 >> -              ;; citations, etc. in the original message before\r
153 >> -              ;; quoting.\r
154 >> -              (let ((notmuch-show-insert-text/plain-hook nil))\r
155 >> +              (let\r
156 >> +                  ;; Don't attempt to clean up messages, excerpt\r
157 >> +                  ;; citations, etc. in the original message before\r
158 >> +                  ;; quoting.\r
159 >> +                  ((notmuch-show-insert-text/plain-hook nil)\r
160 >> +                   ;; Don't omit long parts.\r
161 >> +                   (notmuch-show-max-text-part-size 0)\r
162 >> +                   ;; Insert headers for parts as appropriate for replying.\r
163 >> +                   (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function))\r
164 >>                  (notmuch-show-insert-body original (plist-get original :body) 0)\r
165 >>                  (buffer-substring-no-properties (point-min) (point-max)))))\r
166 >>  \r
167 >> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
168 >> index f4a65cc..7ff9ed5 100644\r
169 >> --- a/emacs/notmuch-show.el\r
170 >> +++ b/emacs/notmuch-show.el\r
171 >> @@ -959,6 +959,19 @@ (defun notmuch-show-insert-header-p (part hide)\r
172 >>      (not (and (string= mime-type "text/plain")\r
173 >>            (<= (plist-get part :id) 1)))))\r
174 >>  \r
175 >> +(defun notmuch-show-reply-insert-header-p-never (part hide)\r
176 >> +  nil)\r
177 >> +\r
178 >> +(defun notmuch-show-reply-insert-header-p-trimmed (part hide)\r
179 >> +  (let ((mime-type (notmuch-show-mime-type part)))\r
180 >> +    (and (not (notmuch-match-content-type mime-type "multipart/*"))\r
181 >> +     (not hide))))\r
182 >> +\r
183 >> +(defun notmuch-show-reply-insert-header-p-minimal (part hide)\r
184 >> +  (let ((mime-type (notmuch-show-mime-type part)))\r
185 >> +    (and (notmuch-match-content-type mime-type "text/*")\r
186 >> +     (not hide))))\r
187 >> +\r
188 >>  (defun notmuch-show-insert-bodypart (msg part depth &optional hide)\r
189 >>    "Insert the body part PART at depth DEPTH in the current thread.\r
190 >>  \r
191 >> -- \r
192 >> 2.1.4\r