From 881ccbb5772943ccc2bf938689758e4119996017 Mon Sep 17 00:00:00 2001 From: Todd Date: Sun, 11 Jan 2015 08:28:32 +1800 Subject: [PATCH] [PATCH v3] emacs: Use the message cite variable instead of a calling cite-message-original directly --- 8d/6aa2d133ac35f80d0fdd5fd5537a83be928038 | 128 ++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 8d/6aa2d133ac35f80d0fdd5fd5537a83be928038 diff --git a/8d/6aa2d133ac35f80d0fdd5fd5537a83be928038 b/8d/6aa2d133ac35f80d0fdd5fd5537a83be928038 new file mode 100644 index 000000000..4ed0b4969 --- /dev/null +++ b/8d/6aa2d133ac35f80d0fdd5fd5537a83be928038 @@ -0,0 +1,128 @@ +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 DF3DB429E40 + for ; Sat, 10 Jan 2015 06:29:05 -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 eSpL4BX8JqB5 for ; + Sat, 10 Jan 2015 06:28:58 -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 A2537431E84 + for ; Sat, 10 Jan 2015 06:28:57 -0800 (PST) +Received: from user-69-73-37-128.knology.net ([69.73.37.128]:33470 + helo=localhost.localdomain) + by server75.web-hosting.com with esmtpsa (UNKNOWN:AES128-SHA256:128) + (Exim 4.82) (envelope-from ) + id 1Y9x28-0040bM-S9; Sat, 10 Jan 2015 09:28:57 -0500 +From: Todd +To: notmuch@notmuchmail.org +Subject: [PATCH v3] emacs: Use the message cite variable instead of a calling + cite-message-original directly +Date: Sat, 10 Jan 2015 08:28:32 -0600 +Message-Id: <1420900112-9187-1-git-send-email-todd@electricoding.com> +X-Mailer: git-send-email 1.9.1 +In-Reply-To: <87sifjjbdf.fsf@maritornes.cs.unb.ca> +References: <87sifjjbdf.fsf@maritornes.cs.unb.ca> +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: Sat, 10 Jan 2015 14:29:07 -0000 + +This fixes the test failure. I didn't have dtach installed, so the +tests were being skipped earlier. As to why the test fails, it +appears that the default for message-cite-function may depend on the +version of Emacs that you use. + +This will likely cause notmuch replying to behave differently for +users if they upgrade, even if they don't customize +message-cite-function (in the case that it is not +message-cite-original). + +Regarding the quotation changes in the test, it was not being +interpreted correctly without the double quotes. I didn't look into +it in much depth, just fixed it for my case. + +- Todd + + +--- + emacs/notmuch-mua.el | 6 +++--- + test/T310-emacs.sh | 7 ++++--- + 2 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el +index 2c58886..66a6b65 100644 +--- a/emacs/notmuch-mua.el ++++ b/emacs/notmuch-mua.el +@@ -220,8 +220,8 @@ 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. ++ ;; message-cite-function should construct 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 +233,7 @@ list." + (set-mark (point)) + (goto-char start) + ;; Quote the original message according to the user's configured style. +- (message-cite-original))) ++ (funcall (or message-cite-function 'message-cite-original)))) + + ;; Crypto processing based crypto content of the original message + (when process-crypto +diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh +index d72799b..74d9f58 100755 +--- a/test/T310-emacs.sh ++++ b/test/T310-emacs.sh +@@ -378,10 +378,11 @@ EOF + test_expect_equal_file OUTPUT EXPECTED + + test_begin_subtest "Reply within emacs to a multipart/mixed message" +-test_emacs '(let ((message-hidden-headers ''())) +- (notmuch-show "id:20091118002059.067214ed@hikari") ++test_emacs "(let ((message-hidden-headers '()) ++ (message-cite-function 'message-cite-original)) ++ (notmuch-show \"id:20091118002059.067214ed@hikari\") + (notmuch-show-reply) +- (test-output))' ++ (test-output))" + sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT + cat <EXPECTED + From: Notmuch Test Suite +-- +1.9.1 + -- 2.26.2