Re: Hooks for sending/replying to set a custom header

Subject: Re: Hooks for sending/replying to set a custom header

Date: Sun, 06 Oct 2024 22:37:54 -0700

To: David Bremner, notmuch@notmuchmail.org

Cc:

From: Xiyue Deng


David Bremner <david@tethera.net> writes:

> Xiyue Deng <manphiz@gmail.com> writes:
>
>>>
>>> There is also message-server-alist, which does not need a header.
>>
>> Thanks for the tip!  I think that should work, though I'd like a more
>> notmuch-ish solution if possible.  And in fact I had some success on
>> advising `notmuch-mua-mail' and reacting on 'From from `other-headers'.
>>
>> I wonder whether notmuch may consider adding an abnormal hook that pass
>> in `headers' as an argument so that we don't need to use an advice?
>
> I'd consider message-server-alist to be the "notmuch-ish" solution,
> since we generally expect message-mode configuration to work for
> notmuch-message-mode.

Thanks for the suggestion!  I wasn't aware of this variable and I think
this does exactly what I intend to do.

One slight inconvenience is that the settings are used to set the header
during `message-send', which means you may not see the header being set
when you are editing the mail.  So if there is an error in your setting
you may not notice it until it is sent, which could be a bit late.  I
wish there is something that can be used to do this in
`message-mode-hook', but I guess I can settle for this for now.

Again, thanks for the tip and the work on notmuch!

-- 
Xiyue Deng
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: