unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Todd <todd@electricoding.com>
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	[thread overview]
Message-ID: <1420900112-9187-1-git-send-email-todd@electricoding.com> (raw)
In-Reply-To: <87sifjjbdf.fsf@maritornes.cs.unb.ca>

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 <<EOF >EXPECTED
 From: Notmuch Test Suite <test_suite@notmuchmail.org>
-- 
1.9.1

  reply	other threads:[~2015-01-10 14:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09  1:19 [PATCH] Use the message cite variable instead of a hard coded function Todd
2015-01-09  7:50 ` David Bremner
2015-01-09 12:33   ` Todd
2015-01-09 13:56     ` Tomi Ollila
2015-01-09 23:37       ` [PATCH v2] emacs: Use the message cite variable Todd
2015-01-10  8:19         ` David Bremner
2015-01-10 14:28           ` Todd [this message]
2015-01-14 19:57             ` [PATCH] emacs: make citation function customizable David Bremner
2015-01-14 23:56               ` Todd
2015-01-16  8:15               ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1420900112-9187-1-git-send-email-todd@electricoding.com \
    --to=todd@electricoding.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).