[PATCH v3 5/5] emacs: Use message-citation-line-format in reply

Adam Wolfe Gordon awg+notmuch at xvx.ca
Thu Jan 19 20:46:46 PST 2012


On Thu, Jan 19, 2012 at 11:45, Aaron Ecay <ecay at sas.upenn.edu> wrote:
> Shouldn’t this just use message-insert-formatted-citation-line?

Yes, good idea.  I just tried this and it almost works.  The only
issue is that the default message-mode-citation-line-format has a
newline at the end, and this function inserts an *additional* newline,
so we end up with a blank line before the beginning of the quoted
text.  This is fixable by the user, of course, but it means the
default out-of-the-box setup will create funny-looking replies, which
is probably bad.  Thoughts?

> Another approach you might take with this patch series is to look at
> the message-cite-original function (which I just discovered as I was
> plumbing around in message.el looking for the function to format the
> citation line).  I think that what one does to use this fn is to put
> the original message text into the reply buffer (unquoted), set point
> and mark to encompass it, then call the fn.  It automatically handles
> inserting the quotes, and has some customization options (stripping
> signatures from replies, customizable quote character instead of “>”,
> ...).
>
> The message-cite-original function also adds escape characters to the
> cookies that message-mode uses to indicate sign/encrypt/attach
> directives.  I think notmuch exposes files on the user’s computer to
> others, if a user can be tricked into replying to a message with an
> attachment cookie and not stripping the cookie from the reply text.  So
> to mitigate this, whatever reply mechanism winds up being used should
> call mml-quote-region on the reply text (as message-cite-original does).

I've also tried using message-cite-original to create the reply body,
and it also almost works.  The issue, again, is one of defaults.  In
addition to the blank line I mentioned above, the default
message-citation-line-function inserts the "plain" citation line "Foo
<foo at bar.baz> writes:" instead of the formatted one.  This is a big
change from the current notmuch default.

If everyone's OK with this and willing to customize it themselves,
then I'm happy to go with this solution, but I'm pretty reluctant to
change the default in such a significant way.


More information about the notmuch mailing list