unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Edmondson <dme@dme.org>
To: notmuch@notmuchmail.org
Subject: [PATCH v1 4/4] emacs: reply: Allow washing of inserted text parts during reply
Date: Sun, 27 Aug 2017 14:46:23 +0100	[thread overview]
Message-ID: <20170827134623.20041-5-dme@dme.org> (raw)
In-Reply-To: <20170827134623.20041-1-dme@dme.org>

When inserting a text/plain part during reply generation, add a hook
that allows the user to improve the display of the part.

As an example, the function `notmuch-wash-tidy-citations' might be
called.
---
 emacs/notmuch-mua.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index fd64b362..4d352626 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -115,6 +115,13 @@ mutiple parts get a header."
 		(function :tag "Other"))
   :group 'notmuch-reply)
 
+(defcustom notmuch-mua-reply-text/plain-hook nil
+  "Functions used to improve the display of text/plain parts in replies.
+
+This is analogous to `notmuch-show-insert-text/plain-hook'."
+  :type 'hook
+  :group 'notmuch-reply)
+
 ;;
 
 (defun notmuch-mua-get-switch-function ()
@@ -249,7 +256,7 @@ mutiple parts get a header."
 		      ;; Don't attempt to clean up messages, excerpt
 		      ;; citations, etc. in the original message before
 		      ;; quoting.
-		      ((notmuch-show-insert-text/plain-hook nil)
+		      ((notmuch-show-insert-text/plain-hook notmuch-mua-reply-text/plain-hook)
 		       ;; Don't omit long parts.
 		       (notmuch-show-max-text-part-size 0)
 		       ;; Insert headers for parts as appropriate for replying.
-- 
2.11.0

  parent reply	other threads:[~2017-08-27 13:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-27 13:46 [PATCH v1 0/4] Improved citation washing David Edmondson
2017-08-27 13:46 ` [PATCH v1 1/4] emacs: wash: Wrap long lines after tidying citations David Edmondson
2017-09-04 11:31   ` David Bremner
2017-08-27 13:46 ` [PATCH v1 2/4] emacs: wash: Improved citation tidying David Edmondson
2017-08-27 13:46 ` [PATCH v1 3/4] emacs: test: Update expected output David Edmondson
2017-09-04 11:34   ` David Bremner
2017-08-27 13:46 ` David Edmondson [this message]
2017-09-04 11:45 ` [PATCH v1 0/4] Improved citation washing 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=20170827134623.20041-5-dme@dme.org \
    --to=dme@dme.org \
    --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).