[PATCH 2/2] emacs: Correctly quote non-text/plain parts in reply

Adam Wolfe Gordon awg+notmuch at xvx.ca
Sat May 5 12:17:11 PDT 2012

On Fri, May 4, 2012 at 1:05 PM, Austin Clements <amdragon at mit.edu> wrote:
> Personally I think the narrowing trick is clever, but I worry that it
> assumes too much about how mm-display-part works, since mm-display-part
> just takes a buffer in the handle.  Is there a reason this doesn't
> simply use notmuch-show-mm-display-part-inline?  Something like
> (untested)
> (defun notmuch-mua-insert-quotable-part (message part)
>  (notmuch-show-mm-display-part-inline
>   message part (plist-get part :id) (plist-get part :content-type)))
> You might not even need notmuch-mua-insert-quotable-part.  (Why does
> notmuch-show-mm-display-part-inline take all of those redundant
> arguments?)

This almost works - patch forthcoming. The trouble with just using
notmuch-show-mm-display-part-inline is that it doesn't move the point
to the end of the text, which we rely on for message-cite-original to
quote the right region. But, I can use
notmuch-show-mm-display-part-inline (moved to the lib) by narrowing
first, and setting the point after using it. If we don't narrow, the
point ends up after the user's signature (which is inserted by message
mode before we insert the quoted text), and the signature ends up
being quoted.

> In general, I feel like the reply code should share more structure with
> the notmuch-show code.  I worry that the quoted text people wind up with
> may not resemble the text they saw in the show buffer because the two
> code paths use different rules.  But addressing that (if it's
> addressable) should be done in a later series.

Yeah, I agree with this. Maybe before 0.14 I will try to do some
refactoring to share code between reply and show, at least in emacs.

-- Adam

More information about the notmuch mailing list