--- /dev/null
+Return-Path: <bremner@tesseract.cs.unb.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 1D082431FCF\r
+ for <notmuch@notmuchmail.org>; Wed, 14 Jan 2015 11:59:03 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.438\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.438 tagged_above=-999 required=5\r
+ tests=[DNS_FROM_AHBL_RHSBL=2.438] 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 ZS1oDz+lNnLs for <notmuch@notmuchmail.org>;\r
+ Wed, 14 Jan 2015 11:58:59 -0800 (PST)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id DE753431FC3\r
+ for <notmuch@notmuchmail.org>; Wed, 14 Jan 2015 11:58:59 -0800 (PST)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+ (envelope-from <bremner@tesseract.cs.unb.ca>)\r
+ id 1YBU5g-0006Kc-8I; Wed, 14 Jan 2015 15:58:56 -0400\r
+Received: (nullmailer pid 18800 invoked by uid 1000); Wed, 14 Jan 2015\r
+ 19:58:51 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: make citation function customizable.\r
+Date: Wed, 14 Jan 2015 20:57:49 +0100\r
+Message-Id: <1421265469-18655-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <1420900112-9187-1-git-send-email-todd@electricoding.com>\r
+References: <1420900112-9187-1-git-send-email-todd@electricoding.com>\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: Wed, 14 Jan 2015 19:59:03 -0000\r
+\r
+Make a new customizable variable instead of relying on\r
+message-cite-function because the default for the latter changed\r
+between emacs releases.\r
+\r
+The defcustom is borrowed from the message.el source, with minor\r
+modifications.\r
+---\r
+\r
+Thanks to Todd for tracking down the wibbly wobbly timey wimey behaviour of this variable. I propose to add our own variable to avoid surprising notmuch-emacs users.\r
+\r
+ emacs/notmuch-mua.el | 23 ++++++++++++++++++++---\r
+ 1 file changed, 20 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index 2c58886..33f1399 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -75,6 +75,22 @@ list."\r
+ :type '(repeat string)\r
+ :group 'notmuch-send)\r
+ \r
++(defgroup notmuch-reply nil\r
++ "Replying to messages in notmuch"\r
++ :group 'notmuch)\r
++\r
++(defcustom notmuch-mua-cite-function 'message-cite-original\r
++ "*Function for citing an original message.\r
++Predefined functions include `message-cite-original' and\r
++`message-cite-original-without-signature'.\r
++Note that these functions use `mail-citation-hook' if that is non-nil."\r
++ :type '(radio (function-item message-cite-original)\r
++ (function-item message-cite-original-without-signature)\r
++ (function-item sc-cite-original)\r
++ (function :tag "Other"))\r
++ :link '(custom-manual "(message)Insertion Variables")\r
++ :group 'notmuch-reply)\r
++\r
+ ;;\r
+ \r
+ (defun notmuch-mua-get-switch-function ()\r
+@@ -220,8 +236,9 @@ list."\r
+ (date (plist-get original-headers :Date))\r
+ (start (point)))\r
+ \r
+- ;; message-cite-original constructs a citation line based on the From and Date\r
+- ;; headers of the original message, which are assumed to be in the buffer.\r
++ ;; notmuch-mua-cite-function constructs a citation line based\r
++ ;; on the From and Date headers of the original message, which\r
++ ;; are assumed to be in the buffer.\r
+ (insert "From: " from "\n")\r
+ (insert "Date: " date "\n\n")\r
+ \r
+@@ -233,7 +250,7 @@ list."\r
+ (set-mark (point))\r
+ (goto-char start)\r
+ ;; Quote the original message according to the user's configured style.\r
+- (message-cite-original)))\r
++ (funcall notmuch-mua-cite-function)))\r
+ \r
+ ;; Crypto processing based crypto content of the original message\r
+ (when process-crypto\r
+-- \r
+2.1.4\r
+\r