GNU bug report logs - #4258
Feature Request - Rmail - Html

Previous Next

Package: emacs;

Reported by: Marco Oliva <marcooliva <at> sapo.pt>

Date: Tue, 25 Aug 2009 18:45:04 UTC

Severity: wishlist

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4258 in the body.
You can then email your comments to 4258 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4258; Package emacs. (Tue, 25 Aug 2009 18:45:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Marco Oliva <marcooliva <at> sapo.pt>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Tue, 25 Aug 2009 18:45:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Marco Oliva <marcooliva <at> sapo.pt>
To: bug-gnu-emacs <at> gnu.org
Subject: Feature Request - Rmail - Html
Date: Tue, 25 Aug 2009 19:36:10 +0100
Please, include in rmail, support for html.

Thanks in advance.




Severity set to 'wishlist' from 'normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Wed, 26 Aug 2009 01:25:06 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Tue, 07 Jan 2014 19:13:02 GMT) Full text and rfc822 format available.

Message #10 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
To: 4258 <at> debbugs.gnu.org
Subject: [patch] HTML mail in rmail
Date: Fri, 27 Dec 2013 15:10:59 -0500
[Message part 1 (text/plain, inline)]
Here is some code for handling HTML parts.  To show the part it funcalls
rmail-mime-render-html-function, which defaults to using shr if libxml
is available, or lynx if you have that.  Other methods could be written.
In the long run it would probably be better to integrate rmail mime
handling with gnus mime handling, but that seems like a big job.

Even if you use shr, if it does not render images called for by the html
part, because asynchronous retrieving of images gets confused by rmail's
buffer-swapping.  (Personally, I'm using lynx, because I don't want my
email to look like a web page.  I just want to figure out what the
sender had to say.)

If the message is only HTML, it just renders it.  But if there is an
alternative text/plain part, it prefers that and you have to use the
"Show" button to get the HTML rendered.

It does not render HTML on searching, so searching looks through the
actual HTML.  Otherwise it would be very slow if you have a large mail
file.

Here is a bazaar bundle.

                                        Ken

[html-patch.text (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Wed, 20 Aug 2014 14:20:02 GMT) Full text and rfc822 format available.

Message #13 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
Cc: 4258 <at> debbugs.gnu.org
Subject: Re: Your Emacs contributions
Date: Wed, 20 Aug 2014 10:19:33 -0400
> The main thing that I've been trying to contribute (besides
> miscellaneous small enhancements and bug fixes) is some code for HTML
> rendering in rmail.  The patch is in
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4258 already.

Oh, right I see it.  Hmm... it seems noone has reviewed it.
The patch looks fairly good to me, but not knowing much if anything
about Rmail's rendering, I'd appreciate some comment from someone a bit
more familiar with this code.

> I guess in addition to the now completed legal paperwork it is waiting
> for the freeze to be lifted.

The freeze was lifted several months ago already,


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Wed, 20 Aug 2014 14:49:02 GMT) Full text and rfc822 format available.

Message #16 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 4258 <at> debbugs.gnu.org, kdo <at> cosmos.phy.tufts.edu
Subject: Re: bug#4258: Your Emacs contributions
Date: Wed, 20 Aug 2014 17:48:15 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Date: Wed, 20 Aug 2014 10:19:33 -0400
> Cc: 4258 <at> debbugs.gnu.org
> 
> > The main thing that I've been trying to contribute (besides
> > miscellaneous small enhancements and bug fixes) is some code for HTML
> > rendering in rmail.  The patch is in
> > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4258 already.
> 
> Oh, right I see it.  Hmm... it seems noone has reviewed it.

I did.

> The patch looks fairly good to me, but not knowing much if anything
> about Rmail's rendering, I'd appreciate some comment from someone a bit
> more familiar with this code.

I plan on starting to use it soon, and if it does a good job, I will
commit it.

Thanks for your contribution, Ken, and sorry for being so slow in
installing it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Tue, 26 Aug 2014 18:46:01 GMT) Full text and rfc822 format available.

Message #19 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: kdo <at> cosmos.phy.tufts.edu
Cc: 4258 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#4258: Your Emacs contributions
Date: Tue, 26 Aug 2014 21:45:33 +0300
> Date: Wed, 20 Aug 2014 17:48:15 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 4258 <at> debbugs.gnu.org, kdo <at> cosmos.phy.tufts.edu
> 
> I plan on starting to use it soon, and if it does a good job, I will
> commit it.

So far it looks very good, but I do have one question: when a mail has
both a text and an HTML form, is there any way to show HTML in
preference to text, rather than the other way around?  I think HTML
should be the default with this patch installed.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Wed, 27 Aug 2014 14:31:02 GMT) Full text and rfc822 format available.

Message #22 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 4258 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#4258: Your Emacs contributions
Date: Wed, 27 Aug 2014 10:30:06 -0400
   From: Eli Zaretskii <eliz <at> gnu.org>
   Date: Tue, 26 Aug 2014 21:45:33 +0300

   ...when a mail has both a text and an HTML form, is there any way to
   show HTML in preference to text, rather than the other way around?  I
   think HTML should be the default with this patch installed.

Not at the moment, but I agree there should be.  Sometimes you get
messages with text segments that say "go read the html instead" and even
when the text is a converted copy of the HTML it is often inferior to
what you could get by rendering it yourself.  On the other hand, this
seems like it should be a user preference, so how about a switch
rmail-mime-prefer-html?

Would you like a second patch to add this functionality or a new patch
including what I sent before with this enhancement?

                                        Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Wed, 27 Aug 2014 14:59:02 GMT) Full text and rfc822 format available.

Message #25 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
Cc: 4258 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#4258: Your Emacs contributions
Date: Wed, 27 Aug 2014 17:58:42 +0300
> From: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
> Cc: monnier <at> iro.umontreal.ca, 4258 <at> debbugs.gnu.org
> Date: Wed, 27 Aug 2014 10:30:06 -0400
> 
> how about a switch rmail-mime-prefer-html?

Fine with me.

> Would you like a second patch to add this functionality or a new patch
> including what I sent before with this enhancement?

Whatever is easier for you, I will cope with either.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Thu, 28 Aug 2014 15:19:02 GMT) Full text and rfc822 format available.

Message #28 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: kdo <at> cosmos.phy.tufts.edu
Cc: 4258 <at> debbugs.gnu.org
Subject: Re: bug#4258: Your Emacs contributions
Date: Thu, 28 Aug 2014 18:18:19 +0300
> Date: Tue, 26 Aug 2014 21:45:33 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 4258 <at> debbugs.gnu.org
> 
> So far it looks very good

Here's one problem I found: if the HTML includes non-ASCII characters
(in the case I saw, the entire HTML part was quoted-printable
encoded), Rmail shows the HTML, but does not decode the non-ASCII
text.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Thu, 04 Sep 2014 15:53:02 GMT) Full text and rfc822 format available.

Message #31 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 4258 <at> debbugs.gnu.org
Subject: Preferring HTML parts
Date: Thu, 04 Sep 2014 11:52:04 -0400
[Message part 1 (text/plain, inline)]
Here's a patch with all my HTML rendering code, including preferring to
render an html part rather than showing the alternative text part, if
the variable rmail-mime-prefer-html is set, which is the default.

I don't know too much about non-ASCII characters, so maybe this patch
could be installed and someone who knows what they're doing could try to
address that issue.

                                        Ken

[html-patch-new.text (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Thu, 04 Sep 2014 16:29:02 GMT) Full text and rfc822 format available.

Message #34 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 4258 <at> debbugs.gnu.org
Subject: Re: bug#4258: Preferring HTML parts
Date: Thu, 04 Sep 2014 12:28:34 -0400
> + (defcustom rmail-mime-prefer-html
> +   t

We should only prefer html if we have a renderer (i.e. if
rmail-mime-render-html-function is non-nil).

I skipped the rest of the patch since I'm not familiar with Rmail and
even less with Rmail's MIME handling.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Thu, 04 Sep 2014 18:00:03 GMT) Full text and rfc822 format available.

Message #37 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: eliz <at> gnu.org, 4258 <at> debbugs.gnu.org
Subject: Re: bug#4258: Preferring HTML parts
Date: Thu, 04 Sep 2014 13:59:40 -0400
Good point.  I can't see why anyone would ever want to preferentially
display the unrendered html, so I think if
rmail-mime-render-html-function is nil we should ignore
rmail-mime-prefer-html and always prefer plain text.  I'll send a new
patch after I see if anyone else has comments.

                                        Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Thu, 04 Sep 2014 20:29:02 GMT) Full text and rfc822 format available.

Message #40 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
Cc: eliz <at> gnu.org, 4258 <at> debbugs.gnu.org
Subject: Re: bug#4258: Preferring HTML parts
Date: Thu, 04 Sep 2014 16:27:54 -0400
> Good point.  I can't see why anyone would ever want to preferentially
> display the unrendered html,

Maybe that's just a lack of imagination.  FWIW I used to do just that
(and then manually pipe the text through some external html2txt filter).

> so I think if rmail-mime-render-html-function is nil we should ignore
> rmail-mime-prefer-html and always prefer plain text.

I think it's simpler to default to nil if
rmail-mime-render-html-function is nil, but still obey
rmail-mime-prefer-html if the user set it to t.  No need to second guess
the user.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Sat, 06 Sep 2014 15:20:02 GMT) Full text and rfc822 format available.

Message #43 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
Cc: 4258 <at> debbugs.gnu.org
Subject: Re: Preferring HTML parts
Date: Sat, 06 Sep 2014 18:19:49 +0300
> From: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
> Cc: 4258 <at> debbugs.gnu.org
> Date: Thu, 04 Sep 2014 11:52:04 -0400
> 
> Here's a patch with all my HTML rendering code, including preferring to
> render an html part rather than showing the alternative text part, if
> the variable rmail-mime-prefer-html is set, which is the default.

Thanks.  I started using it, and so far the results are very good.

> I don't know too much about non-ASCII characters, so maybe this patch
> could be installed and someone who knows what they're doing could try to
> address that issue.

I did that as well.

So when you send a new patch, I will commit it together with my
additions for decoding non-ASCII HTML text.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Sun, 07 Sep 2014 00:12:02 GMT) Full text and rfc822 format available.

Message #46 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 4258 <at> debbugs.gnu.org
Subject: Re: Preferring HTML parts
Date: Sat, 06 Sep 2014 20:11:03 -0400
[Message part 1 (text/plain, inline)]
OK, here is a new version of the patch including the change to only
default rmail-mime-prefer-html to t if we have a renderer.

                                  Ken

[html-patch-new.text (text/plain, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 13 Sep 2014 09:30:03 GMT) Full text and rfc822 format available.

Notification sent to Marco Oliva <marcooliva <at> sapo.pt>:
bug acknowledged by developer. (Sat, 13 Sep 2014 09:30:04 GMT) Full text and rfc822 format available.

Message #51 received at 4258-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
Cc: 4258-done <at> debbugs.gnu.org
Subject: Re: Preferring HTML parts
Date: Sat, 13 Sep 2014 12:29:29 +0300
> From: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
> Cc: 4258 <at> debbugs.gnu.org
> Date: Sat, 06 Sep 2014 20:11:03 -0400
> 
> OK, here is a new version of the patch including the change to only
> default rmail-mime-prefer-html to t if we have a renderer.

Thanks.  Installed as trunk revision 117871.

I followed up with 2 additional commits: one to decode the HTML using
the transfer-encoding specified by the mail message, and another to
bind shr-width to nil during HTML rendering, so that the rendered
lines are not broken too early (which screws up display of many HTML
messages, e.g., the parts that cite messages being replied to).

Thank you for all your hard work.  I'm now closing this bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Sat, 13 Sep 2014 16:45:06 GMT) Full text and rfc822 format available.

Message #54 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 4258 <at> debbugs.gnu.org
Cc: eliz <at> gnu.org, marcooliva <at> sapo.pt
Subject: Re: bug#4258: Preferring HTML parts
Date: Sat, 13 Sep 2014 12:44:59 -0400
Worth a mention in NEWS?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4258; Package emacs. (Sat, 13 Sep 2014 19:04:02 GMT) Full text and rfc822 format available.

Message #57 received at 4258 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: marcooliva <at> sapo.pt, 4258 <at> debbugs.gnu.org
Subject: Re: bug#4258: Preferring HTML parts
Date: Sat, 13 Sep 2014 22:03:14 +0300
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: eliz <at> gnu.org,  marcooliva <at> sapo.pt
> Date: Sat, 13 Sep 2014 12:44:59 -0400
> 
> 
> Worth a mention in NEWS?

Definitely; done.

Thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 12 Oct 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 207 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.