Handling Outlook-style quoting in Gnus
Asked Answered
H

1

7

Since a lot of my workflow is Emacs-based, I'm trying to migrate to using Gnus at the office. Most people here use Outlook and with it rely on the Microsoft-style top-quoting in replies.

I've set things up quite nicely with markdown automatically converted to HTML when I post etc. The problem is that I end with the text version of the quoted messages in the reply thread instead of the original HTML email. This is not really appreciated by the other participants in the thread.

My question is: Is there a way in which I can preserve the original HTML in the reply-chain when replying using top-posting style?

I've been looking at various ways of doing it myself, but there is actually a lot of work doing it right, as it involves parsing the original HTML and inserting my message in the right place, etc. So I was hoping that someone else might have done this already.

Hypothermal answered 10/2, 2012 at 4:46 Comment(2)
What exactly gets pasted when you C-c C-y (message-yank-original) In the reply buffer?About
It yanks the text version of the reply, prefixed with ">" characters. That is not what I want, since the original HTML-formatting must be preserved.Bair
H
5

After a long time, this question has remained unanswered so I concluded that no one has had the need to do this.

So, I resorted to solve it myself. My solution involves taking the message that is written, passing it through muse in order to format it as HTML, then passing this generated HTML together with the original HTML source of the original mail and send it to an external application that I wrote that parses the HTML and merges them into a new HTML document. This HTML is them returned and is then inserted into the email buffer before being submitted.

There was quite a lot of hackery needed in order to make sure that attachments are handled correctly, but in the end it all worked out well.

The code is available at: https://github.com/lokedhs/gnus-outlook-style

Hypothermal answered 2/8, 2012 at 3:42 Comment(5)
Yes, please, I'd really like to see this code, especially the "passing it through muse in order to format it as HTML".About
It would be useful to upload the snippet on EmacsWiki or even here on stackoverflow!Revoke
I will create a post on EmacsWiki about it.Bair
Looks like the code is over here now: github.com/lokedhs/gnus-outlook-styleFeudalism
Yes, you are right. It moved to github some time ago. I'll update the post.Bair

© 2022 - 2024 — McMap. All rights reserved.