Re: Flat search and threaded views
[notmuch-archives.git] / 35 / 627e40a1f24955c321b285f7a628824f6db02f
1 Return-Path: <amdragon@mit.edu>\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 8FCCB431FB6\r
6         for <notmuch@notmuchmail.org>; Sun, 13 Jan 2013 20:14:00 -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 A8E2V3crkrBb for <notmuch@notmuchmail.org>;\r
16         Sun, 13 Jan 2013 20:13:59 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU\r
18         [18.7.68.36])\r
19         by olra.theworths.org (Postfix) with ESMTP id 991B8431FAF\r
20         for <notmuch@notmuchmail.org>; Sun, 13 Jan 2013 20:13:59 -0800 (PST)\r
21 X-AuditID: 12074424-b7f4e6d0000004ca-e3-50f386068a34\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
23         by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 3F.85.01226.60683F05; Sun, 13 Jan 2013 23:13:58 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id r0E4Dvek022954; \r
27         Sun, 13 Jan 2013 23:13:58 -0500\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id r0E4DteM006509\r
32         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
33         Sun, 13 Jan 2013 23:13:56 -0500 (EST)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1Tuabm-00023Y-IN; Sun, 13 Jan 2013 22:21:10 -0500\r
37 Date: Sun, 13 Jan 2013 22:21:10 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Mark Walters <markwalters1009@gmail.com>\r
40 Subject: Re: [PATCH v3] emacs: show: possible w3m/invisibility workaround\r
41 Message-ID: <20130114032047.GW17581@mit.edu>\r
42 References: <1357862220-1219-1-git-send-email-markwalters1009@gmail.com>\r
43         <1358081032-3066-1-git-send-email-markwalters1009@gmail.com>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 Content-Disposition: inline\r
47 In-Reply-To: <1358081032-3066-1-git-send-email-markwalters1009@gmail.com>\r
48 User-Agent: Mutt/1.5.21 (2010-09-15)\r
49 X-Brightmail-Tracker:\r
50  H4sIAAAAAAAAA+NgFupnleLIzCtJLcpLzFFi42IRYrdT0WVr+xxgcLFJwGL1XB6L6zdnMjsw\r
51         eeycdZfd49mqW8wBTFFcNimpOZllqUX6dglcGZvf72IqeCBdcWtJO1MD4yqxLkZODgkBE4m/\r
52         k36yQNhiEhfurWcDsYUE9jFKfFwq2cXIBWRvYJQ43viBDcK5yCTxa+khVghnCaPEupe9YC0s\r
53         AqoSp7Y0gNlsAhoS2/YvZwSxRQR0JG4fWsAOYjMLSEt8+93MBGILC3hKHFl6FyzOC1Rz9sgC\r
54         Zoih7YwSv67uZ4ZICEqcnPmEBaJZS+LGv5dAzRxgg5b/4wAJcwLN+XythRXEFhVQkZhychvb\r
55         BEahWUi6ZyHpnoXQvYCReRWjbEpulW5uYmZOcWqybnFyYl5eapGuuV5uZoleakrpJkZwWLuo\r
56         7GBsPqR0iFGAg1GJh3dDyecAIdbEsuLK3EOMkhxMSqK8Vo1AIb6k/JTKjMTijPii0pzU4kOM\r
57         EhzMSiK8oXVAOd6UxMqq1KJ8mJQ0B4uSOO/1lJv+QgLpiSWp2ampBalFMFkZDg4lCV6GVqBG\r
58         waLU9NSKtMycEoQ0EwcnyHAeoOHrWkCGFxck5hZnpkPkTzHqcux/0v6cUYglLz8vVUqc9zxI\r
59         kQBIUUZpHtwcWDp6xSgO9JYw72aQKh5gKoOb9ApoCRPQkrMX3oMsKUlESEk1MLq/EeystC7u\r
60         EjtmmRay+oL4qaypW2dvaZZeNmPdiruqfb+bcyreSX3gr68yLUjKSv3aXhaUWPI14v7aIh+d\r
61         dUvknRlTmk2SKqX6DkyYFpN8ZpqDfN3DctUtxo6no235rkZmhHAJ6//8Y/2zOsFmlvUNH5e7\r
62         Aveavs458uHw+snh1hpvk5iuK7EUZyQaajEXFScCAHvnrfUiAwAA\r
63 Cc: notmuch@notmuchmail.org\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: Mon, 14 Jan 2013 04:14:00 -0000\r
77 \r
78 LGTM.  It's too bad the w3m-link-map logic in\r
79 mm-inline-text-html-render-with-w3m doesn't appear to work; it looks\r
80 like that would make links follow-able without completely taking over.\r
81 \r
82 Quoth Mark Walters on Jan 13 at 12:43 pm:\r
83 > There is a bug in the current notmuch code with w3m and invisible\r
84 > parts. w3m sets a keymap, and if we have a hidden [text/html] point\r
85 > at the start of the following line still gets this w3m keymap which\r
86 > causes some strange effects. For example, RET gives an error "No URL\r
87 > at Point" rather than hiding the message, <down> goes to the next link\r
88 > rather than just down a line.\r
89\r
90 > These keybinding are also inconvenient when the text/html part is\r
91 > displayed so we ask w3m not to install a keymap.\r
92\r
93 > This is only likely to be a problem for emacs 23 as shr is preferred\r
94 > as html renderer on emacs 24 (although the user can set the renderer\r
95 > to w3m even on emacs 24).\r
96\r
97 > This solution was suggested by Tomi Ollila <tomi.ollila@iki.fi>\r
98 > ---\r
99\r
100 > On irc Tomi found the correct way of stopping w3m setting a keymap:\r
101 > there is a variable mm-inline-text-html-with-w3m-keymap which can be\r
102 > set to nil to tell w3m not to set a keymap.\r
103\r
104 > I think this is the best solution to this bug for 0.15. My view is\r
105 > that this is correct anyway: w3m does render quickly and nicely (and\r
106 > will probably be my default renderer from now on) and with this patch\r
107 > the keybinding problems are the normal notmuch bindings.\r
108\r
109 > Jani pointed out that in the new invisibility setup all text/html\r
110 > parts are rendered (invisibly) when notmuch-show runs. We may want to\r
111 > allow the user to supress this: in fact they can by setting\r
112 > mm-text-html-renderer to nil but we may want to allow the suppression\r
113 > without affecting gnus etc, or we may want to link this option into\r
114 > the notmuch-show customization, or maybe just mention in NEWS.\r
115 \r
116 Could we make it simply render parts on demand when/if they become\r
117 visible?  There would be no loss of functionality and things would be\r
118 faster overall.\r
119 \r
120 > Any such fix is a obviously a separate patch.\r
121\r
122 > Best wishes\r
123\r
124 > Mark\r
125\r
126\r
127\r
128 >  emacs/notmuch-show.el |   10 ++++++++++\r
129 >  1 files changed, 10 insertions(+), 0 deletions(-)\r
130\r
131 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
132 > index 5751d98..1864dd1 100644\r
133 > --- a/emacs/notmuch-show.el\r
134 > +++ b/emacs/notmuch-show.el\r
135 > @@ -818,6 +818,16 @@ message at DEPTH in the current thread."\r
136 >  (defun notmuch-show-insert-part-inline-patch-fake-part (msg part content-type nth depth declared-type)\r
137 >    (notmuch-show-insert-part-*/* msg part "text/x-diff" nth depth "inline patch"))\r
138 >  \r
139 > +(defun notmuch-show-insert-part-text/html (msg part content-type nth depth declared-type)\r
140 > +  ;; text/html handler to work around bugs in renderers and our\r
141 > +  ;; invisibile parts code. In particular w3m sets up a keymap which\r
142 > +  ;; "leaks" outside the invisible region and causes strange effects\r
143 > +  ;; in notmuch. We set mm-inline-text-html-with-w3m-keymap to nil to\r
144 > +  ;; tell w3m not to set a keymap (so the normal notmuch-show-mode-map\r
145 > +  ;; remains).\r
146 > +  (let ((mm-inline-text-html-with-w3m-keymap nil))\r
147 > +    (notmuch-show-insert-part-*/* msg part content-type nth depth declared-type)))\r
148 > +\r
149 >  (defun notmuch-show-insert-part-*/* (msg part content-type nth depth declared-type)\r
150 >    ;; This handler _must_ succeed - it is the handler of last resort.\r
151 >    (notmuch-show-insert-part-header nth content-type declared-type (plist-get part :filename))\r