Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / b0 / f79ebaad5835120604436a5fc1bfd4ca85e694
1 Return-Path: <m.walters@qmul.ac.uk>\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 E01DB431FBC\r
6         for <notmuch@notmuchmail.org>; Sun, 24 Jun 2012 11:56:22 -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: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 VSXTpPOBmmAT for <notmuch@notmuchmail.org>;\r
17         Sun, 24 Jun 2012 11:56:22 -0700 (PDT)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 06425431FAE\r
22         for <notmuch@notmuchmail.org>; Sun, 24 Jun 2012 11:56:22 -0700 (PDT)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1Siryp-0006pQ-EB; Sun, 24 Jun 2012 19:56:17 +0100\r
27 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]\r
28         helo=localhost)\r
29         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
30         (envelope-from <m.walters@qmul.ac.uk>)\r
31         id 1Siryp-00045g-5Z; Sun, 24 Jun 2012 19:56:15 +0100\r
32 From: Mark Walters <markwalters1009@gmail.com>\r
33 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
34 Subject: Re: [PATCH v2] emacs: add function to toggle display of all\r
35         multipart/alternative parts\r
36 In-Reply-To: <1340136889-2992-1-git-send-email-jani@nikula.org>\r
37 References: <1339775751-18002-1-git-send-email-jani@nikula.org>\r
38         <1340136889-2992-1-git-send-email-jani@nikula.org>\r
39 User-Agent: Notmuch/0.13.2+63~g548a9bf (http://notmuchmail.org) Emacs/23.4.1\r
40         (x86_64-pc-linux-gnu)\r
41 Date: Sun, 24 Jun 2012 19:56:09 +0100\r
42 Message-ID: <8762agh73q.fsf@qmul.ac.uk>\r
43 MIME-Version: 1.0\r
44 Content-Type: text/plain; charset=us-ascii\r
45 X-Sender-Host-Address: 94.192.233.223\r
46 X-QM-SPAM-Info: Sender has good ham record.  :)\r
47 X-QM-Body-MD5: 75a738151befa2cd1cb7a10af76bebc5 (of first 20000 bytes)\r
48 X-SpamAssassin-Score: -1.8\r
49 X-SpamAssassin-SpamBar: -\r
50 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
51         determine if it is\r
52         spam. We require at least 5.0 points to mark a message as spam.\r
53         This message scored -1.8 points.\r
54         Summary of the scoring: \r
55         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
56         *      medium trust\r
57         *      [138.37.6.40 listed in list.dnswl.org]\r
58         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
59         provider *      (markwalters1009[at]gmail.com)\r
60         * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
61         *      domain\r
62         *  0.5 AWL AWL: From: address is in the auto white-list\r
63 X-QM-Scan-Virus: ClamAV says the message is clean\r
64 X-BeenThere: notmuch@notmuchmail.org\r
65 X-Mailman-Version: 2.1.13\r
66 Precedence: list\r
67 List-Id: "Use and development of the notmuch mail system."\r
68         <notmuch.notmuchmail.org>\r
69 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
72 List-Post: <mailto:notmuch@notmuchmail.org>\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
74 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
75         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
76 X-List-Received-Date: Sun, 24 Jun 2012 18:56:23 -0000\r
77 \r
78 \r
79 On Tue, 19 Jun 2012, Jani Nikula <jani@nikula.org> wrote:\r
80 > Add function notmuch-show-toggle-multipart-alternative to toggle the\r
81 > value of notmuch-show-all-multipart/alternative-parts variable in the\r
82 > buffer, and redisplay the thread with either all or preferred\r
83 > alternative parts expanded.\r
84 >\r
85 > A small wrinkle is that in order to make the variable survive\r
86 > notmuch-show-refresh-view (which is required for expanding/collapsing\r
87 > the parts, but ends up calling kill-all-local-variables through\r
88 > notmuch-show-mode) it is necessary to give it the permanent-local\r
89 > property.\r
90 \r
91 Hi \r
92 \r
93 This patch looks good to me with one small concern: I set the\r
94 variable notmuch-show-all-multipart/alternative-parts in my an emacs file\r
95 loaded from my .emacs file rather than through customize using \r
96 (setq notmuch-show-all-multipart/alternative-parts nil)\r
97 \r
98 This no longer works because of the buffer local property (ie I see all\r
99 parts): I need to use \r
100 (setq-default notmuch-show-all-multipart/alternative-parts nil)\r
101 \r
102 This "change" might be worth flagging up in the news file.\r
103 \r
104 I do not think the existence of my semi-patch\r
105 id:"87pq8vokmp.fsf@qmul.ac.uk" should hold up this patch. My patch is\r
106 only a draft and I definitely do not know enough lisp to be able to\r
107 write a correct version (with correct quoting of message-ids etc).\r
108 \r
109 Best wishes\r
110 \r
111 Mark\r
112 \r
113 \r
114 \r
115 > ---\r
116 >  emacs/notmuch-show.el |   12 ++++++++++++\r
117 >  1 file changed, 12 insertions(+)\r
118 >\r
119 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
120 > index 36cad93..4d3f03f 100644\r
121 > --- a/emacs/notmuch-show.el\r
122 > +++ b/emacs/notmuch-show.el\r
123 > @@ -98,6 +98,18 @@ any given message."\r
124 >    "Should all parts of multipart/alternative parts be shown?"\r
125 >    :type 'boolean\r
126 >    :group 'notmuch-show)\r
127 > +(make-variable-buffer-local 'notmuch-show-all-multipart/alternative-parts)\r
128 > +(put 'notmuch-show-all-multipart/alternative-parts 'permanent-local t)\r
129 > +\r
130 > +(defun notmuch-show-toggle-multipart-alternative ()\r
131 > +  "Toggle the display of all multipart/alternative parts."\r
132 > +  (interactive)\r
133 > +  (setq notmuch-show-all-multipart/alternative-parts\r
134 > +     (not notmuch-show-all-multipart/alternative-parts))\r
135 > +  (message (if notmuch-show-all-multipart/alternative-parts\r
136 > +            "Showing all multipart/alternative parts."\r
137 > +          "Showing preferred multipart/alternative part."))\r
138 > +  (notmuch-show-refresh-view))\r
139 >  \r
140 >  (defcustom notmuch-show-indent-messages-width 1\r
141 >    "Width of message indentation in threads.\r
142 > -- \r
143 > 1.7.9.5\r
144 >\r
145 > _______________________________________________\r
146 > notmuch mailing list\r
147 > notmuch@notmuchmail.org\r
148 > http://notmuchmail.org/mailman/listinfo/notmuch\r