[PATCH v2] emacs: insert quotable parts in reply as they are displayed in show view

Mark Walters markwalters1009 at gmail.com
Fri Aug 30 09:49:34 PDT 2013


> In reply, insert quotable parts using notmuch-show-insert-bodypart
> instead of calling notmuch-mm-display-part-inline directly to render
> the quoted parts as they are rendered in show view.
>
> The notable change is that replies to text/calendar parts quote the
> pretty printed output of icalendar-import-buffer rather than the ugly
> raw vcalendar.

I slightly worry that some text-properties or similar from notmuch-show
could make their way into the reply buffer: in particular it would be
very bad if any invisible character made it into the buffer. I don't
think this is actually a problem currently but just in case (and to
avoid future problems) how about the following on top of the parent
patch?

Best wishes

Mark

---
 emacs/notmuch-mua.el |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index e7cc94e..9e4a232 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -134,9 +134,11 @@ list."
     (narrow-to-region (point-min) (point))
     ;; We don't want hooks, such as notmuch-wash-*, to be run on the
     ;; quotable part.
-    (let ((notmuch-show-insert-text/plain-hook nil))
-      ;; Show the part but do not add buttons.
-      (notmuch-show-insert-bodypart message part 0 'no-buttons))
+    (insert (with-temp-buffer
+	      (let ((notmuch-show-insert-text/plain-hook nil))
+		;; Show the part but do not add buttons.
+		(notmuch-show-insert-bodypart message part 0 'no-buttons))
+	      (buffer-substring-no-properties (point-min) (point-max))))
     (goto-char (point-max))))
 
 ;; There is a bug in emacs 23's message.el that results in a newline
-- 
1.7.9.1



More information about the notmuch mailing list