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 772CC429E54 for ; Sun, 22 Jan 2012 10:58:33 -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 u1K-FPPPM-W0 for ; Sun, 22 Jan 2012 10:58:32 -0800 (PST) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by olra.theworths.org (Postfix) with ESMTP id 95733429E40 for ; Sun, 22 Jan 2012 10:58:32 -0800 (PST) Received: from pd3ml1so-ssvc.prod.shaw.ca ([10.0.141.140]) by pd4mo1so-svcs.prod.shaw.ca with ESMTP; 22 Jan 2012 11:58:31 -0700 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=MPNiKFfsidoaPqBs0kThsodqbsbgvPHp5CGEg9DOvhI= c=1 sm=1 a=QF8m4hWxz6YA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17 a=7343-z1_AAAA:8 a=m5C_-5U5OX2FoCRDEqMA:9 a=vUWflj0j9QKj9EB_nVkA:7 a=0c-eHkXYtrgA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56]) by pd3ml1so-dmz.prod.shaw.ca with ESMTP; 22 Jan 2012 11:58:31 -0700 Received: by lagos.xvx.ca (Postfix, from userid 1000) id 31BDE8004203; Sun, 22 Jan 2012 11:58:31 -0700 (MST) From: Adam Wolfe Gordon To: notmuch@notmuchmail.org Subject: [PATCH v3 5/5] emacs: Use message-cite-original in reply Date: Sun, 22 Jan 2012 11:58:18 -0700 Message-Id: <1327258698-23853-1-git-send-email-awg+notmuch@xvx.ca> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1326995217-27423-6-git-send-email-awg+notmuch@xvx.ca> References: <1326995217-27423-6-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: Sun, 22 Jan 2012 18:58:33 -0000 Use message-mode's message-cite-original function to create the quoted body for reply messages. In order to make this act like the existing notmuch defaults, you will need to set the following in your emacs configuration: message-citation-line-format "On %a, %d %b %Y, %f wrote:" message-citation-line-function 'message-insert-formatted-citation-line The test has been updated to reflect the (ugly) emacs default. --- Here is an alternate version of the patch, which uses message-cite-original. I suggest people try out this version and see if the behavior is acceptable with some configuration tweaks. If it is, then we can work on implementing the notmuch-emacs config file idea, and go with this version. As I mentioned, the one thing I haven't figured out how to do with configuration is make message-cite-original fill the quoted message. This would probably be a dealbreaker for me, but I suspect it can be done somehow with the right combination of hooks. emacs/notmuch-mua.el | 32 +++++++++++++++++++------------- test/emacs | 3 ++- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 5ae0ccf..45c314d 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -21,6 +21,7 @@ (require 'json) (require 'message) +(require 'format-spec) (require 'notmuch-lib) (require 'notmuch-address) @@ -134,19 +135,24 @@ list." (forward-line -1) (goto-char (point-max))) - (insert (format "On %s, %s wrote:\n" - (cdr (assq 'date original-headers)) - (cdr (assq 'from original-headers)))) - - (if plain-parts - (mapc (lambda (part) (notmuch-mua-insert-part-quoted part)) plain-parts) - (mapc (lambda (part) - (notmuch-mua-insert-part-quoted (notmuch-mua-parse-html-part part))) - html-parts)) - - (push-mark)) - (set-buffer-modified-p nil)) - + (let ((from (cdr (assq 'from original-headers))) + (date (cdr (assq 'date original-headers))) + (start (point))) + + (insert "From: " from "\n") + (insert "Date: " date "\n\n") + + (if plain-parts + (mapc 'insert plain-parts) + (mapc (lambda (part) + (insert (notmuch-mua-parse-html-part part))) + html-parts)) + (push-mark) + (goto-char start) + (message-cite-original)))) + + (push-mark) + (set-buffer-modified-p nil) (message-goto-body)) (defun notmuch-mua-forward-message () diff --git a/test/emacs b/test/emacs index ac47b16..aecbf41 100755 --- a/test/emacs +++ b/test/emacs @@ -268,7 +268,8 @@ Subject: Re: Testing message sent via SMTP In-Reply-To: Fcc: $(pwd)/mail/sent --text follows this line-- -On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite wrote: +Notmuch Test Suite writes: + > This is a test that messages are sent via SMTP EOF test_expect_equal_file OUTPUT EXPECTED -- 1.7.5.4