[PATCH v2 5/4] emacs: Add customization for the first line of quotes.
authorAdam Wolfe Gordon <awg+notmuch@xvx.ca>
Tue, 17 Jan 2012 01:18:59 +0000 (18:18 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:42:22 +0000 (09:42 -0800)
3e/04a2bf12a47ddfdf42fa68bd2556748de4a49e [new file with mode: 0644]

diff --git a/3e/04a2bf12a47ddfdf42fa68bd2556748de4a49e b/3e/04a2bf12a47ddfdf42fa68bd2556748de4a49e
new file mode 100644 (file)
index 0000000..772cf88
--- /dev/null
@@ -0,0 +1,103 @@
+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 40FBE429E3B\r
+       for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 17:19: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 OFq-mhMlKrLt for <notmuch@notmuchmail.org>;\r
+       Mon, 16 Jan 2012 17:19:07 -0800 (PST)\r
+Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9])\r
+       by olra.theworths.org (Postfix) with ESMTP id AED2A429E35\r
+       for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 17:19:07 -0800 (PST)\r
+Received: from lb7f8hsrpno-svcs.dcs.int.inet (HELO pd6ml3no-ssvc.prod.shaw.ca)\r
+       ([10.0.144.222])\r
+       by pd6mo1no-svcs.prod.shaw.ca with ESMTP; 16 Jan 2012 18:19:05 -0700\r
+X-Cloudmark-SP-Filtered: true\r
+X-Cloudmark-SP-Result: v=1.1 cv=gFGh1ScE7ROJHT2jhivHYaSHya8441O0LZB7wkhlVyo=\r
+       c=1 sm=1\r
+       a=uWECbD2RVlEA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17\r
+       a=Y2B7Pfn4WVGIM53Y2qsA:9 a=2_Xq26Wg9FFebKwHAtUA:7\r
+       a=HpAAvcLHHh0Zw7uRqdWCyQ==:117\r
+Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56])\r
+       by pd6ml3no-dmz.prod.shaw.ca with ESMTP; 16 Jan 2012 18:19:05 -0700\r
+Received: by lagos.xvx.ca (Postfix, from userid 1000)\r
+       id A8E828004208; Mon, 16 Jan 2012 18:19:05 -0700 (MST)\r
+From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 5/4] emacs: Add customization for the first line of quotes.\r
+Date: Mon, 16 Jan 2012 18:18:59 -0700\r
+Message-Id: <1326763139-31146-1-git-send-email-awg+notmuch@xvx.ca>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <1326737603-21166-1-git-send-email-awg+notmuch@xvx.ca>\r
+References: <1326737603-21166-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: Tue, 17 Jan 2012 01:19:08 -0000\r
+\r
+Add a customization option, notmuch-mua-reply-quoth, which controls\r
+the first line of the reply body (typically, "On %date%, %from% wrote:").\r
+This allows users who like other styles or correspond in other languages\r
+to set an appropriate line using any of the quoted message's headers.\r
+---\r
+\r
+Due to some subsequent discussions in the thread about my original patch series,\r
+I decided I may as well implement this sooner rather than later.\r
+\r
+ emacs/notmuch-mua.el |   16 ++++++++++++----\r
+ 1 files changed, 12 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index b03c62c..c7fd9f8 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -91,6 +91,14 @@ list."\r
+       (fill-region (point-min) (point-max))\r
+       (buffer-substring (point-min) (point-max)))))\r
\r
++(defcustom notmuch-mua-reply-quoth "On %date%, %from% wrote:"\r
++  "The first line of a reply body, typically 'On %date%, %from% wrote:'.\r
++\r
++Any header fields from the message being replied to can be inserted by\r
++enclosing them in percents."\r
++  :group 'notmuch\r
++  :type 'string)\r
++\r
+ (defun notmuch-mua-reply (query-string &optional sender reply-all)\r
+   (let ((args '("reply" "--format=json"))\r
+       reply\r
+@@ -132,10 +140,10 @@ 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
+-         \r
++      (let ((quoth (replace-regexp-in-string "%.+?%" \r
++                                           (lambda (hdr) (cdr (assq (intern (substring hdr 1 (- (length hdr) 1))) original-headers)))\r
++                                           notmuch-mua-reply-quoth)))\r
++      (insert quoth "\n"))\r
\r
+       (if (null plain-parts)\r
+         (mapc (lambda (part) (notmuch-mua-insert-part-quoted (notmuch-mua-parse-html-part part))) html-parts)\r
+-- \r
+1.7.5.4\r
+\r