1 Return-Path: <tomi.ollila@iki.fi>
\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 BAB72431FB6
\r
6 for <notmuch@notmuchmail.org>; Sun, 13 Jan 2013 05:41:37 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 HF9FXAhJtQAY for <notmuch@notmuchmail.org>;
\r
16 Sun, 13 Jan 2013 05:41:36 -0800 (PST)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 61AB3431FAF
\r
19 for <notmuch@notmuchmail.org>; Sun, 13 Jan 2013 05:41:36 -0800 (PST)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id BAD81100045;
\r
22 Sun, 13 Jan 2013 15:41:25 +0200 (EET)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
\r
25 Subject: Re: [PATCH v3] emacs: show: possible w3m/invisibility workaround
\r
26 In-Reply-To: <1358081032-3066-1-git-send-email-markwalters1009@gmail.com>
\r
27 References: <1357862220-1219-1-git-send-email-markwalters1009@gmail.com>
\r
28 <1358081032-3066-1-git-send-email-markwalters1009@gmail.com>
\r
29 User-Agent: Notmuch/0.14+259~g287394f (http://notmuchmail.org) Emacs/24.2.1
\r
30 (x86_64-unknown-linux-gnu)
\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
32 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
33 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
34 Date: Sun, 13 Jan 2013 15:41:25 +0200
\r
35 Message-ID: <m2zk0db3p6.fsf@guru.guru-group.fi>
\r
37 Content-Type: text/plain
\r
38 X-BeenThere: notmuch@notmuchmail.org
\r
39 X-Mailman-Version: 2.1.13
\r
41 List-Id: "Use and development of the notmuch mail system."
\r
42 <notmuch.notmuchmail.org>
\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
46 List-Post: <mailto:notmuch@notmuchmail.org>
\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
50 X-List-Received-Date: Sun, 13 Jan 2013 13:41:38 -0000
\r
52 On Sun, Jan 13 2013, Mark Walters <markwalters1009@gmail.com> wrote:
\r
54 > There is a bug in the current notmuch code with w3m and invisible
\r
55 > parts. w3m sets a keymap, and if we have a hidden [text/html] point
\r
56 > at the start of the following line still gets this w3m keymap which
\r
57 > causes some strange effects. For example, RET gives an error "No URL
\r
58 > at Point" rather than hiding the message, <down> goes to the next link
\r
59 > rather than just down a line.
\r
61 > These keybinding are also inconvenient when the text/html part is
\r
62 > displayed so we ask w3m not to install a keymap.
\r
64 > This is only likely to be a problem for emacs 23 as shr is preferred
\r
65 > as html renderer on emacs 24 (although the user can set the renderer
\r
66 > to w3m even on emacs 24).
\r
68 > This solution was suggested by Tomi Ollila <tomi.ollila@iki.fi>
\r
73 > On irc Tomi found the correct way of stopping w3m setting a keymap:
\r
74 > there is a variable mm-inline-text-html-with-w3m-keymap which can be
\r
75 > set to nil to tell w3m not to set a keymap.
\r
77 I was lucky when looking through the list provided by
\r
78 M-x customize-group mime-display to figure out whether the whole
\r
79 group could be referenced from notmuch-show customization group
\r
80 -- and happened to notice the customization variable in question.
\r
82 I have previously discussed "against" picking up individiual external
\r
83 customization variables to notmuch groups (just due that I could not
\r
84 find it done before). In case of notmuch-send, there is line
\r
85 (custom-add-to-group 'notmuch-send 'message 'custom-group)
\r
86 in notmuch-lib.el -- as message sending uses message mode (and there
\r
87 are plenty of useful customization there it makes sense to reference
\r
88 the whole group. In case of mm-display functionality that doesn't
\r
89 seem to be the case...
\r
93 > I think this is the best solution to this bug for 0.15. My view is
\r
94 > that this is correct anyway: w3m does render quickly and nicely (and
\r
95 > will probably be my default renderer from now on) and with this patch
\r
96 > the keybinding problems are the normal notmuch bindings.
\r
98 > Jani pointed out that in the new invisibility setup all text/html
\r
99 > parts are rendered (invisibly) when notmuch-show runs. We may want to
\r
100 > allow the user to supress this: in fact they can by setting
\r
101 > mm-text-html-renderer to nil but we may want to allow the suppression
\r
102 > without affecting gnus etc, or we may want to link this option into
\r
103 > the notmuch-show customization, or maybe just mention in NEWS.
\r
105 > Any such fix is a obviously a separate patch.
\r
113 > emacs/notmuch-show.el | 10 ++++++++++
\r
114 > 1 files changed, 10 insertions(+), 0 deletions(-)
\r
116 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
117 > index 5751d98..1864dd1 100644
\r
118 > --- a/emacs/notmuch-show.el
\r
119 > +++ b/emacs/notmuch-show.el
\r
120 > @@ -818,6 +818,16 @@ message at DEPTH in the current thread."
\r
121 > (defun notmuch-show-insert-part-inline-patch-fake-part (msg part content-type nth depth declared-type)
\r
122 > (notmuch-show-insert-part-*/* msg part "text/x-diff" nth depth "inline patch"))
\r
124 > +(defun notmuch-show-insert-part-text/html (msg part content-type nth depth declared-type)
\r
125 > + ;; text/html handler to work around bugs in renderers and our
\r
126 > + ;; invisibile parts code. In particular w3m sets up a keymap which
\r
127 > + ;; "leaks" outside the invisible region and causes strange effects
\r
128 > + ;; in notmuch. We set mm-inline-text-html-with-w3m-keymap to nil to
\r
129 > + ;; tell w3m not to set a keymap (so the normal notmuch-show-mode-map
\r
131 > + (let ((mm-inline-text-html-with-w3m-keymap nil))
\r
132 > + (notmuch-show-insert-part-*/* msg part content-type nth depth declared-type)))
\r
134 > (defun notmuch-show-insert-part-*/* (msg part content-type nth depth declared-type)
\r
135 > ;; This handler _must_ succeed - it is the handler of last resort.
\r
136 > (notmuch-show-insert-part-header nth content-type declared-type (plist-get part :filename))
\r
140 > _______________________________________________
\r
141 > notmuch mailing list
\r
142 > notmuch@notmuchmail.org
\r
143 > http://notmuchmail.org/mailman/listinfo/notmuch
\r