[PATCH 1/1] emacs: fix notmuch-mua-reply point placement when signature involved
Jani Nikula
jani at nikula.org
Thu Sep 5 09:42:11 PDT 2013
On Thu, 05 Sep 2013, Tomi Ollila <tomi.ollila at iki.fi> wrote:
> On Thu, Sep 05 2013, Jani Nikula <jani at nikula.org> wrote:
>
>> On Wed, 04 Sep 2013, "Tomi.Ollila" <tomi.ollila at iki.fi> wrote:
>>> From: Tomi Ollila <tomi.ollila at iki.fi>
>>>
>>> When composing a reply, notmuch-mua-reply attempts to cite the
>>> the original message by inserting it before the user signature, if
>>> one is present. The existing method used to search the signature
>>> separator backward from the end of the buffer and then move one
>>> line up. In case of variable `message-signature-insert-empty-line'
>>> being nil (and `message-signature-setup-hook' not intervening) this
>>> caused point to go to the beginning of '--text follows this line--'
>>> separator line, and citation was inserted there.
>>> This change checks the value of `message-signature-insert-empty-line'
>>> and doesn't move point if that is nil. Additional narrowing to
>>> the body region ensures that point never goes to the separator line
>>> (or beyond).
>>>
>>> Original patch from "Geoffrey H. Ferrari", continued with iterations
>>> from Jani and Mark.
>>
>> Hi Tomi, I don't think you've sufficiently convinced me why we need all
>> this complexity instead of just doing [1]. And if you do get me
>> convinced, I'd like the reason to be in the commit message and in a
>> comment above the piece of code in question.
>
> (add-hook 'message-signature-setup-hook
> (lambda () (insert "Insert this text before the citation not after.\n")))
>
> From emacs documentation:
>
> message-signature-setup-hook is a variable defined in `message.el'.
> Its value is nil
>
> This variable may be risky if used as a file-local variable.
>
> Documentation:
> Normal hook, run each time a new outgoing message is initialized.
> It is run after the headers have been inserted and before
> the signature is inserted.
>
> You can customize this variable.
>
>
> Adding the comments is a good idea -- if the above convinces you
> I'll prepare comments along this idea.
Meh. Fair enough. Thanks for the explanation.
Cheers,
Jani.
More information about the notmuch
mailing list