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