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 4CD0A429E26 for ; Wed, 30 Nov 2011 08:50:09 -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 QaHH3JRIKeTQ for ; Wed, 30 Nov 2011 08:50:08 -0800 (PST) X-Greylist: delayed 565 seconds by postgrey-1.32 at olra; Wed, 30 Nov 2011 08:50:08 PST Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by olra.theworths.org (Postfix) with ESMTP id 9588E431FB6 for ; Wed, 30 Nov 2011 08:50:08 -0800 (PST) Received: from pd2ml1so-ssvc.prod.shaw.ca ([10.0.141.139]) by pd3mo1so-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=n2W5COKzyCYKBlY96L0A3my6r0xTlngINTUh0kppeyk= c=1 sm=1 a=OJb4Sv6x4FoA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17 a=2T1ejf8vMcL6zZPwiRgA:9 a=5c3mVTZLN-rKsMPNTeEA:7 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56]) by pd2ml1so-dmz.prod.shaw.ca with ESMTP; 30 Nov 2011 09:40:42 -0700 Received: by lagos.xvx.ca (Postfix, from userid 1000) id D7EF3800C2C6; Wed, 30 Nov 2011 09:40:41 -0700 (MST) From: Adam Wolfe Gordon To: notmuch@notmuchmail.org, awg@xvx.ca Subject: [RFC PATCH 3/3] emacs: Optionally quote HTML parts when replying. Date: Wed, 30 Nov 2011 09:40:41 -0700 Message-Id: <1322671241-23438-4-git-send-email-awg+notmuch@xvx.ca> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1322671241-23438-1-git-send-email-awg+notmuch@xvx.ca> References: <1322671241-23438-1-git-send-email-awg+notmuch@xvx.ca> 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:09 -0000 Add support for rendering and quoting HTML parts. Adds a customize option notmuch-mua-quote-html-parts, which when non-nil causes HTML parts to be included in replies using notmuch reply --format=html. --- emacs/notmuch-mua.el | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 8824b08..e7c1315 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -46,6 +46,14 @@ list." :group 'notmuch :type '(repeat string)) +(defcustom notmuch-mua-quote-html-parts nil + "Quote HTML parts when replying to a message. + +If non-nil, notmuch will attempt to render HTML parts using w3m and insert them +into reply buffers." + :group 'notmuch + :type 'boolean) + ;; (defun notmuch-mua-user-agent-full () @@ -69,10 +77,13 @@ list." (push header message-hidden-headers))) notmuch-mua-hidden-headers)) +(defun w3m-region (start end)) ;; From `w3m.el'. (defun notmuch-mua-reply (query-string &optional sender) (let (headers body (args '("reply"))) + (if notmuch-mua-quote-html-parts + (setq args (append args '("--format=html")))) (if notmuch-show-process-crypto (setq args (append args '("--decrypt")))) (setq args (append args (list query-string))) @@ -89,6 +100,18 @@ list." (goto-char (point-min)) (setq headers (mail-header-extract))))) (forward-line 1) + (if notmuch-mua-quote-html-parts + (save-excursion + (if (re-search-forward " " nil nil)))))) (setq body (buffer-substring (point) (point-max)))) ;; If sender is non-nil, set the From: header to its value. (when sender -- 1.7.5.4