unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
To: Mark Walters <markwalters1009@gmail.com>
Cc: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org
Subject: Re: [PATCH v2] emacs: insert quotable parts in reply as they are displayed in show view
Date: Fri, 30 Aug 2013 13:18:07 -0400	[thread overview]
Message-ID: <20130830171807.GB20236@mit.edu> (raw)
In-Reply-To: <87ppsvp1i9.fsf@qmul.ac.uk>

Quoth Mark Walters on Aug 30 at  5:49 pm:
> 
> > 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?

I haven't tested this, but I like the idea.  It won't actually help
with invisible text (though we could fix that in the future if
necessary), but there are plenty of other properties and overlays you
wouldn't want bleeding into the reply buffer.  This puts a clear wall
between the potentially interactive but read-only show output and the
plain but editable reply text.

> 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

  reply	other threads:[~2013-09-01  7:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-27 19:50 [PATCH v2] emacs: insert quotable parts in reply as they are displayed in show view Jani Nikula
2013-08-27 20:14 ` Tomi Ollila
2013-08-29 15:53 ` Jani Nikula
2013-08-30 16:49   ` Mark Walters
2013-08-30 17:18     ` Austin Clements [this message]
2013-09-01 14:54     ` Mark Walters

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=20130830171807.GB20236@mit.edu \
    --to=amdragon@mit.edu \
    --cc=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /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).