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 37DCC431FC0 for ; Thu, 19 Jan 2012 09:47:08 -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 r4clZH3eDkUq for ; Thu, 19 Jan 2012 09:47:07 -0800 (PST) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by olra.theworths.org (Postfix) with ESMTP id F3944431FB6 for ; Thu, 19 Jan 2012 09:47:06 -0800 (PST) Received: from pd3ml2so-ssvc.prod.shaw.ca ([10.0.141.138]) by pd3mo1so-svcs.prod.shaw.ca with ESMTP; 19 Jan 2012 10:47:05 -0700 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=w8ylZ/s5/CpB4NtJ57cq/Y3wf+h+jIFeVVN4WVEh/uc= c=1 sm=1 a=w3EecL4DZPQA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17 a=7343-z1_AAAA:8 a=GpjT01FCzd4eTrbtcU8A:9 a=trVQTHzpZ64-_igdUdIA:7 a=0c-eHkXYtrgA:10 a=KKgeSdN3-Q_mOek0:21 a=cSmX5j7mfm3cSTxy:21 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56]) by pd3ml2so-dmz.prod.shaw.ca with ESMTP; 19 Jan 2012 10:47:05 -0700 Received: by lagos.xvx.ca (Postfix, from userid 1000) id 4302F8003320; Thu, 19 Jan 2012 10:47:05 -0700 (MST) From: Adam Wolfe Gordon To: notmuch@notmuchmail.org Subject: [PATCH v3 5/5] emacs: Use message-citation-line-format in reply Date: Thu, 19 Jan 2012 10:46:57 -0700 Message-Id: <1326995217-27423-6-git-send-email-awg+notmuch@xvx.ca> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1326995217-27423-1-git-send-email-awg+notmuch@xvx.ca> References: <1326995217-27423-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: Thu, 19 Jan 2012 17:47:08 -0000 Instead of using a static citation line for the first line of the reply message, use the customizable one defined by message-mode. This makes it easy for users to customize the reply style, and retains consistency for users with existing message-mode customizations. --- emacs/notmuch-mua.el | 19 ++++++++++++++++--- test/emacs | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 5ae0ccf..e485d93 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -134,9 +134,22 @@ 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)))) + (let* ((quoth message-citation-line-format) + (case-fold-search nil) + (full-from (cdr (assq 'from original-headers))) + (from-addr (car (mail-header-parse-address full-from))) + (from-name (cdr (mail-header-parse-address full-from))) + (first-name (car (split-string from-name))) + (last-name (append (cdr (split-string from-name)))) + (time (date-to-time (cdr (assq 'date original-headers))))) + + (setq quoth (replace-regexp-in-string "%f" full-from quoth t t)) + (setq quoth (replace-regexp-in-string "%n" from-addr quoth t t)) + (setq quoth (replace-regexp-in-string "%N" from-name quoth t t)) + (setq quoth (replace-regexp-in-string "%F" first-name quoth t t)) + (setq quoth (replace-regexp-in-string "%L" last-name quoth t t)) + (setq quoth (format-time-string quoth time)) + (insert quoth)) (if plain-parts (mapc (lambda (part) (notmuch-mua-insert-part-quoted part)) plain-parts) diff --git a/test/emacs b/test/emacs index ac47b16..3f59b23 100755 --- a/test/emacs +++ b/test/emacs @@ -268,7 +268,7 @@ 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: +On Sat, Jan 01 2000, Notmuch Test Suite wrote: > This is a test that messages are sent via SMTP EOF test_expect_equal_file OUTPUT EXPECTED -- 1.7.5.4