unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: David Pinto <carandraug@gmail.com>, notmuch@notmuchmail.org
Subject: Re: automatically changing FCC when From changes (or fill FCC only when sending)
Date: Fri, 22 Sep 2023 07:25:27 -0300	[thread overview]
Message-ID: <874jjm33oo.fsf@tethera.net> (raw)
In-Reply-To: <CAPOrs_1xQHRqPDvs=j7N4jzW7UNt_GkFcWMwAdCpqFq4xiW1jQ@mail.gmail.com>

David Pinto <carandraug@gmail.com> writes:

>
> I see what you mean, how changing the FCC would prevent the ability to
> manually edit the FCC.  But what about updating the FCC when the
> "From" changes?

I don't know how to efficiently detect changes to
From. (notmuch-)message-mode is essentially a text editor buffer,
including the header area, so I think one would have to reparse the
buffer after every keystroke. I think that would be annoyingly slow, but
I haven't tried it. The hook is called "post-command-hook" if you are
feeling adventurous, but see the warnings in the docstring.

> You mention updating the "From" when the "To" changes with the
> notmuch-address-post-completion-functions hook.  Could there be a hook
> for when the "From" changes which I could use to change the FCC?

My partial-solution relies on using completion to change To. If you are
OK with that (i.e. manual editing without completion would not update
Fcc), then the same scheme could work.

Another option that seems technically feasible, but would involve some
elisp programming, would be to write a command that re-applies the
calculation of Fcc from From that already exists, and run that manually
or perhaps opt-in to running it automatically on send.

  reply	other threads:[~2023-09-22 10:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-16  0:18 automatically changing FCC when From changes (or fill FCC only when sending) David Pinto
2023-09-16 16:17 ` David Bremner
2023-09-21 23:19   ` David Pinto
2023-09-22 10:25     ` David Bremner [this message]
2023-09-22 10:41       ` David Bremner
2023-10-02 10:28       ` David Pinto

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=874jjm33oo.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=carandraug@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /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).