From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>
To: notmuch@notmuchmail.org
Subject: [PATCH v3 5/5] emacs: Use message-cite-original in reply
Date: Sun, 22 Jan 2012 11:58:18 -0700 [thread overview]
Message-ID: <1327258698-23853-1-git-send-email-awg+notmuch@xvx.ca> (raw)
In-Reply-To: <1326995217-27423-6-git-send-email-awg+notmuch@xvx.ca>
Use message-mode's message-cite-original function to create the
quoted body for reply messages. In order to make this act like the
existing notmuch defaults, you will need to set the following in
your emacs configuration:
message-citation-line-format "On %a, %d %b %Y, %f wrote:"
message-citation-line-function 'message-insert-formatted-citation-line
The test has been updated to reflect the (ugly) emacs default.
---
Here is an alternate version of the patch, which uses message-cite-original.
I suggest people try out this version and see if the behavior is
acceptable with some configuration tweaks. If it is, then we can
work on implementing the notmuch-emacs config file idea, and go
with this version. As I mentioned, the one thing I haven't figured
out how to do with configuration is make message-cite-original fill
the quoted message. This would probably be a dealbreaker for me, but
I suspect it can be done somehow with the right combination of hooks.
emacs/notmuch-mua.el | 32 +++++++++++++++++++-------------
test/emacs | 3 ++-
2 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 5ae0ccf..45c314d 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -21,6 +21,7 @@
(require 'json)
(require 'message)
+(require 'format-spec)
(require 'notmuch-lib)
(require 'notmuch-address)
@@ -134,19 +135,24 @@ list."
(forward-line -1)
(goto-char (point-max)))
- (insert (format "On %s, %s wrote:\n"
- (cdr (assq 'date original-headers))
- (cdr (assq 'from original-headers))))
-
- (if plain-parts
- (mapc (lambda (part) (notmuch-mua-insert-part-quoted part)) plain-parts)
- (mapc (lambda (part)
- (notmuch-mua-insert-part-quoted (notmuch-mua-parse-html-part part)))
- html-parts))
-
- (push-mark))
- (set-buffer-modified-p nil))
-
+ (let ((from (cdr (assq 'from original-headers)))
+ (date (cdr (assq 'date original-headers)))
+ (start (point)))
+
+ (insert "From: " from "\n")
+ (insert "Date: " date "\n\n")
+
+ (if plain-parts
+ (mapc 'insert plain-parts)
+ (mapc (lambda (part)
+ (insert (notmuch-mua-parse-html-part part)))
+ html-parts))
+ (push-mark)
+ (goto-char start)
+ (message-cite-original))))
+
+ (push-mark)
+ (set-buffer-modified-p nil)
(message-goto-body))
(defun notmuch-mua-forward-message ()
diff --git a/test/emacs b/test/emacs
index ac47b16..aecbf41 100755
--- a/test/emacs
+++ b/test/emacs
@@ -268,7 +268,8 @@ Subject: Re: Testing message sent via SMTP
In-Reply-To: <XXX>
Fcc: $(pwd)/mail/sent
--text follows this line--
-On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:
+Notmuch Test Suite <test_suite@notmuchmail.org> writes:
+
> This is a test that messages are sent via SMTP
EOF
test_expect_equal_file OUTPUT EXPECTED
--
1.7.5.4
next prev parent reply other threads:[~2012-01-22 18:58 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-19 17:46 [PATCH v3 0/5] Quoting HTML emails in reply Adam Wolfe Gordon
2012-01-19 17:46 ` [PATCH v3 1/5] test: Add broken test for the new JSON reply format Adam Wolfe Gordon
2012-01-19 17:46 ` [PATCH v3 2/5] reply: Add a " Adam Wolfe Gordon
2012-02-05 11:50 ` Mark Walters
2012-02-05 12:45 ` Mark Walters
2012-02-05 19:42 ` Adam Wolfe Gordon
2012-02-05 19:50 ` Dmitry Kurochkin
2012-02-06 3:44 ` Austin Clements
2012-02-06 6:27 ` Adam Wolfe Gordon
2012-01-19 17:46 ` [PATCH v3 3/5] man: Update notmuch-reply man page for JSON format Adam Wolfe Gordon
2012-01-19 17:46 ` [PATCH v3 4/5] emacs: Use the new JSON reply format Adam Wolfe Gordon
2012-02-05 12:41 ` Mark Walters
2012-01-19 17:46 ` [PATCH v3 5/5] emacs: Use message-citation-line-format in reply Adam Wolfe Gordon
2012-01-19 18:45 ` Aaron Ecay
2012-01-20 4:46 ` Adam Wolfe Gordon
2012-01-20 5:53 ` Aaron Ecay
2012-01-20 9:14 ` David Edmondson
2012-01-20 17:22 ` Adam Wolfe Gordon
2012-01-20 22:31 ` Tomi Ollila
2012-01-22 18:58 ` Adam Wolfe Gordon [this message]
2012-02-09 0:21 ` [PATCH v4 0/4] Quoting HTML parts in reply (and other reply enhancements) Adam Wolfe Gordon
2012-02-09 0:21 ` [PATCH v4 1/4] test: Add broken test for the new JSON reply format Adam Wolfe Gordon
2012-02-09 0:21 ` [PATCH v4 2/4] reply: Add a " Adam Wolfe Gordon
2012-02-09 7:22 ` Dmitry Kurochkin
2012-02-10 4:27 ` Adam Wolfe Gordon
2012-02-10 8:39 ` Dmitry Kurochkin
2012-02-09 0:21 ` [PATCH v4 3/4] man: Update notmuch-reply man page for JSON format Adam Wolfe Gordon
2012-02-09 0:21 ` [PATCH v4 4/4] emacs: Use the new JSON reply format and message-cite-original Adam Wolfe Gordon
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=1327258698-23853-1-git-send-email-awg+notmuch@xvx.ca \
--to=awg+notmuch@xvx.ca \
--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).