[PATCH v3 5/5] emacs: Use message-citation-line-format in reply
authorAdam Wolfe Gordon <awg+notmuch@xvx.ca>
Thu, 19 Jan 2012 17:46:57 +0000 (10:46 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:42:42 +0000 (09:42 -0800)
d5/137e6a72a91bef8c3f782130b95d57ec70b1f5 [new file with mode: 0644]

diff --git a/d5/137e6a72a91bef8c3f782130b95d57ec70b1f5 b/d5/137e6a72a91bef8c3f782130b95d57ec70b1f5
new file mode 100644 (file)
index 0000000..5781794
--- /dev/null
@@ -0,0 +1,110 @@
+Return-Path: <awg@lagos.xvx.ca>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 37DCC431FC0\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 09:47:08 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id r4clZH3eDkUq for <notmuch@notmuchmail.org>;\r
+       Thu, 19 Jan 2012 09:47:07 -0800 (PST)\r
+Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10])\r
+       by olra.theworths.org (Postfix) with ESMTP id F3944431FB6\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 09:47:06 -0800 (PST)\r
+Received: from pd3ml2so-ssvc.prod.shaw.ca ([10.0.141.138])\r
+       by pd3mo1so-svcs.prod.shaw.ca with ESMTP; 19 Jan 2012 10:47:05 -0700\r
+X-Cloudmark-SP-Filtered: true\r
+X-Cloudmark-SP-Result: v=1.1 cv=w8ylZ/s5/CpB4NtJ57cq/Y3wf+h+jIFeVVN4WVEh/uc=\r
+       c=1 sm=1\r
+       a=w3EecL4DZPQA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17\r
+       a=7343-z1_AAAA:8 a=GpjT01FCzd4eTrbtcU8A:9 a=trVQTHzpZ64-_igdUdIA:7\r
+       a=0c-eHkXYtrgA:10 a=KKgeSdN3-Q_mOek0:21 a=cSmX5j7mfm3cSTxy:21\r
+       a=HpAAvcLHHh0Zw7uRqdWCyQ==:117\r
+Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56])\r
+       by pd3ml2so-dmz.prod.shaw.ca with ESMTP; 19 Jan 2012 10:47:05 -0700\r
+Received: by lagos.xvx.ca (Postfix, from userid 1000)\r
+       id 4302F8003320; Thu, 19 Jan 2012 10:47:05 -0700 (MST)\r
+From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 5/5] emacs: Use message-citation-line-format in reply\r
+Date: Thu, 19 Jan 2012 10:46:57 -0700\r
+Message-Id: <1326995217-27423-6-git-send-email-awg+notmuch@xvx.ca>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <1326995217-27423-1-git-send-email-awg+notmuch@xvx.ca>\r
+References: <1326995217-27423-1-git-send-email-awg+notmuch@xvx.ca>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 19 Jan 2012 17:47:08 -0000\r
+\r
+Instead of using a static citation line for the first line of the\r
+reply message, use the customizable one defined by message-mode.\r
+This makes it easy for users to customize the reply style, and\r
+retains consistency for users with existing message-mode\r
+customizations.\r
+---\r
+ emacs/notmuch-mua.el |   19 ++++++++++++++++---\r
+ test/emacs           |    2 +-\r
+ 2 files changed, 17 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index 5ae0ccf..e485d93 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -134,9 +134,22 @@ list."\r
+         (forward-line -1)\r
+       (goto-char (point-max)))\r
\r
+-      (insert (format "On %s, %s wrote:\n"\r
+-                    (cdr (assq 'date original-headers))\r
+-                    (cdr (assq 'from original-headers))))\r
++      (let* ((quoth message-citation-line-format)\r
++           (case-fold-search nil)\r
++           (full-from (cdr (assq 'from original-headers)))\r
++           (from-addr (car (mail-header-parse-address full-from)))\r
++           (from-name (cdr (mail-header-parse-address full-from)))\r
++           (first-name (car (split-string from-name)))\r
++           (last-name (append (cdr (split-string from-name))))\r
++           (time (date-to-time (cdr (assq 'date original-headers)))))\r
++\r
++      (setq quoth (replace-regexp-in-string "%f" full-from quoth t t))\r
++      (setq quoth (replace-regexp-in-string "%n" from-addr quoth t t))\r
++      (setq quoth (replace-regexp-in-string "%N" from-name quoth t t))\r
++      (setq quoth (replace-regexp-in-string "%F" first-name quoth t t))\r
++      (setq quoth (replace-regexp-in-string "%L" last-name quoth t t))\r
++      (setq quoth (format-time-string quoth time))\r
++      (insert quoth))\r
\r
+       (if plain-parts\r
+         (mapc (lambda (part) (notmuch-mua-insert-part-quoted part)) plain-parts)\r
+diff --git a/test/emacs b/test/emacs\r
+index ac47b16..3f59b23 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -268,7 +268,7 @@ Subject: Re: Testing message sent via SMTP\r
+ In-Reply-To: <XXX>\r
+ Fcc: $(pwd)/mail/sent\r
+ --text follows this line--\r
+-On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
++On Sat, Jan 01 2000, Notmuch Test Suite wrote:\r
+ > This is a test that messages are sent via SMTP\r
+ EOF\r
+ test_expect_equal_file OUTPUT EXPECTED\r
+-- \r
+1.7.5.4\r
+\r