Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 9BFEB429E29 for ; Wed, 30 Nov 2011 08:50:22 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eRUJ0EoVb72q for ; Wed, 30 Nov 2011 08:50:20 -0800 (PST) Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by olra.theworths.org (Postfix) with ESMTP id CBA11429E39 for ; Wed, 30 Nov 2011 08:50:16 -0800 (PST) Received: from lb7f8hsrpno-svcs.dcs.int.inet (HELO pd5ml2no-ssvc.prod.shaw.ca) ([10.0.144.222]) by pd7mo1no-svcs.prod.shaw.ca with ESMTP; 30 Nov 2011 09:40:42 -0700 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=1i/nnIW0nMC5uWcUJ59KMVUkrnWI9M+zreV2y9Ww/qI= c=1 sm=1 a=7GgN6RdxzlQA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17 a=2LoIg5_kSO0TY0mPySQA:9 a=DK_ML55IPaTeQFSTg7YA:7 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56]) by pd5ml2no-dmz.prod.shaw.ca with ESMTP; 30 Nov 2011 09:40:42 -0700 Received: by lagos.xvx.ca (Postfix, from userid 1000) id AE8DA800027D; Wed, 30 Nov 2011 09:40:41 -0700 (MST) From: Adam Wolfe Gordon To: notmuch@notmuchmail.org, awg@xvx.ca Subject: [RFC PATCH 0/3] Quoting HTML-only emails in replies Date: Wed, 30 Nov 2011 09:40:38 -0700 Message-Id: <1322671241-23438-1-git-send-email-awg+notmuch@xvx.ca> X-Mailer: git-send-email 1.7.5.4 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2011 16:50:22 -0000 Hi everyone, I use notmuch at work, where the email server is Exchange and the majority of my colleagues use Outlook. This means that I get a fair bit of HTML-only email. When using notmuch reply to create replies to such emails, the quoted body ends up containing only the line "Non-text part: text/html", and if I want to quote them I have to do it manually. This series of patches fixes this issue. It adds a --format=html option to notmuch reply, which acts like --format=default except that it includes HTML parts as well as text parts. The emacs interface render the quoted HTML into text using w3m. I've added a customize option, notmuch-mua-quote-html-parts to control this behavior. I've included a test for the notmuch reply part, though it's not a great one. This code is working well for me, but I'm marking this as RFC because there are a few things that could be better: 1. If an email has a text part and an HTML part they'll both end up quoted, and emacs might make the text part look ugly by trying to render it as HTML. Ideally it should omit HTML parts from the reply when a text part exists, but it looks like this would take some non-trivial refactoring of the notmuch reply code. 2. The easiest way to implement --format=html in notmuch reply was to use a global variable controlling HTML output, which feels clumsy to me. Perhaps someone who is more familiar with the notmuch code can suggest a cleaner way of doing it. 3. As I mentioned, the test I've included isn't great. A test that uses an HTML-only email would be nice, and if (1) can be resolved, then the existing test will have different results. I hope someone else will find these changes useful - please do let me know if you have suggestions. Cheers. Adam Wolfe Gordon (3): test: replies that quote HTML parts (expected to fail) reply: New format 'html' that quotes text/html parts emacs: Optionally quote HTML parts when replying. emacs/notmuch-mua.el | 23 +++++++++++++++++++++++ notmuch-reply.c | 8 +++++++- notmuch.c | 6 +++++- test/multipart | 24 ++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 2 deletions(-) -- 1.7.5.4