From: Todd Date: Wed, 14 Jan 2015 23:56:40 +0000 (+1800) Subject: Re: [PATCH] emacs: make citation function customizable. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e1d4c569dfa2b47e548613509c36d683b65f7433;p=notmuch-archives.git Re: [PATCH] emacs: make citation function customizable. --- diff --git a/f8/269ce41d491b1a343aa5758ba31c87e565ab00 b/f8/269ce41d491b1a343aa5758ba31c87e565ab00 new file mode 100644 index 000000000..8472ac71c --- /dev/null +++ b/f8/269ce41d491b1a343aa5758ba31c87e565ab00 @@ -0,0 +1,172 @@ +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 0DEDE431FD5 + for ; Wed, 14 Jan 2015 15:57:15 -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 gfx-v+JTIQ0U for ; + Wed, 14 Jan 2015 15:57:11 -0800 (PST) +Received: from s75.web-hosting.com (s75.web-hosting.com [198.187.31.9]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id C78C7431FCF + for ; Wed, 14 Jan 2015 15:57:11 -0800 (PST) +Received: from user-69-73-37-128.knology.net ([69.73.37.128]:49696 + helo=tz-lab) by server75.web-hosting.com with esmtpsa + (UNKNOWN:DHE-RSA-AES128-SHA:128) (Exim 4.82) (envelope-from + ) id 1YBXoD-0019vu-DQ; Wed, 14 Jan 2015 18:57:09 + -0500 +From: Todd +To: David Bremner , notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: make citation function customizable. +In-Reply-To: <1421265469-18655-1-git-send-email-david@tethera.net> +References: <1420900112-9187-1-git-send-email-todd@electricoding.com> + <1421265469-18655-1-git-send-email-david@tethera.net> +User-Agent: Notmuch/0.19+17~gd8b219d (http://notmuchmail.org) Emacs/24.4.1 + (x86_64-unknown-linux-gnu) +Date: Wed, 14 Jan 2015 17:56:40 -0600 +Message-ID: <874mrs6hmv.fsf@electricoding.com> +MIME-Version: 1.0 +Content-Type: multipart/signed; boundary="=-=-="; + micalg=pgp-sha1; protocol="application/pgp-signature" +X-AntiAbuse: This header was added to track abuse, + please include it with any abuse report +X-AntiAbuse: Primary Hostname - server75.web-hosting.com +X-AntiAbuse: Original Domain - notmuchmail.org +X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] +X-AntiAbuse: Sender Address Domain - electricoding.com +X-Get-Message-Sender-Via: server75.web-hosting.com: authenticated_id: + todd@electricoding.com +X-Source: +X-Source-Args: +X-Source-Dir: +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 23:57:15 -0000 + +--=-=-= +Content-Type: text/plain +Content-Transfer-Encoding: quoted-printable + + +Looks good to me. I applied the patch and it works fine as well. + +=2D Todd + +>>>>> "DB" =3D=3D David Bremner writes: + + DB> Make a new customizable variable instead of relying on + DB> message-cite-function because the default for the latter changed + DB> between emacs releases. + + DB> The defcustom is borrowed from the message.el source, with minor + DB> modifications. + DB> --- + + DB> Thanks to Todd for tracking down the wibbly wobbly timey wimey beha= +viour of this variable. I propose to add our own variable to avoid surprisi= +ng notmuch-emacs users. + + DB> emacs/notmuch-mua.el | 23 ++++++++++++++++++++--- + DB> 1 file changed, 20 insertions(+), 3 deletions(-) + + DB> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el + DB> index 2c58886..33f1399 100644 + DB> --- a/emacs/notmuch-mua.el + DB> +++ b/emacs/notmuch-mua.el + DB> @@ -75,6 +75,22 @@ list." + DB> :type '(repeat string) + DB> :group 'notmuch-send) +=20 + DB> +(defgroup notmuch-reply nil + DB> + "Replying to messages in notmuch" + DB> + :group 'notmuch) + DB> + + DB> +(defcustom notmuch-mua-cite-function 'message-cite-original + DB> + "*Function for citing an original message. + DB> +Predefined functions include `message-cite-original' and + DB> +`message-cite-original-without-signature'. + DB> +Note that these functions use `mail-citation-hook' if that is non-= +nil." + DB> + :type '(radio (function-item message-cite-original) + DB> + (function-item message-cite-original-without-signature) + DB> + (function-item sc-cite-original) + DB> + (function :tag "Other")) + DB> + :link '(custom-manual "(message)Insertion Variables") + DB> + :group 'notmuch-reply) + DB> + + DB> ;; +=20 + DB> (defun notmuch-mua-get-switch-function () + DB> @@ -220,8 +236,9 @@ list." + DB> (date (plist-get original-headers :Date)) + DB> (start (point))) +=20 + DB> - ;; message-cite-original constructs a citation line based on the = +>From and Date + DB> - ;; headers of the original message, which are assumed to be in th= +e buffer. + DB> + ;; notmuch-mua-cite-function constructs a citation line based + DB> + ;; on the From and Date headers of the original message, which + DB> + ;; are assumed to be in the buffer. + DB> (insert "From: " from "\n") + DB> (insert "Date: " date "\n\n") +=20 + DB> @@ -233,7 +250,7 @@ list." + DB> (set-mark (point)) + DB> (goto-char start) + DB> ;; Quote the original message according to the user's configured = +style. + DB> - (message-cite-original))) + DB> + (funcall notmuch-mua-cite-function))) +=20 + DB> ;; Crypto processing based crypto content of the original mess= +age + DB> (when process-crypto + DB> --=20 + DB> 2.1.4 + + DB> _______________________________________________ + DB> notmuch mailing list + DB> notmuch@notmuchmail.org + DB> http://notmuchmail.org/mailman/listinfo/notmuch + +--=-=-= +Content-Type: application/pgp-signature; name="signature.asc" + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iQIcBAEBAgAGBQJUtwI5AAoJEEc0ULlfRYDu96cP/3FgSKGU+serpctGnbVEMuP4 +YDa4aMfLEldHisofCzzxonqd49PM6GjlKor9DVabmOwswiHjdJBeyN+Mfp2EJ0Zj +btw/1JAu7eZrjDvc1ORGqUhuQ5gzxznSIfSqvNnsT+eLczbh9TqhHyzOz5et03Lw +r19Ddh+BxeRQKpFkX/9VB0TOzwUN5pF/GCtk2FWqghXxxLgb8ymQcfZkWhx7dg1R +F5I5G/Iko+gwBIU0cbFRdwNtoEUiCOHSL35qNEOwpc8DVF/XUE0O1GO7So7y7VuY +yLJUftrMSfNqHmwB15eZPyNcSQhIk6ZKRY8N9pvn7Ltv9poq6TZf6evqaeBiHWQl +XFa41kkvu84jNr4jcuS0qKsoYG/tv2ZgmiT8UpP92uIggP145d7rDjiHEpkaIEOA +ftTVuCm8yFiVsicPwrZqeCnuSP2vauvOaZ8g5ScAdr1X9ljPGvTGCo1WvFM9n1Iu +s3k2CanQZDniSV4zEkWYpmyIgF420/rQJlEAnl6JzVYfta56rKPg8vEZchfGSNLr +Dd80zPXe4aL0bOrAsYK0HTcN+cZ0b/RnIJLIdAPGb1Gw4ptaaURGd/tIkdT6b/Ql +h7s+kv9bU7MvL0OCVKEFMxEcgLNeZrs2OFZNt646kbg4yihFj6YkM7YG5GFoDAbn +tm9y6tkD/Ilqq2lI2zDD +=5r9p +-----END PGP SIGNATURE----- +--=-=-=--