Daniel Kahn Gillmor <d...@fifthhorseman.net> writes: > > I'm currently working around this by setting notmuch-fcc-dirs to nil, > and setting message-send-mail-hook to (dkg-notmuch-fcc), which is defined > as: > > (defun dkg-notmuch-fcc () > (shell-command-on-region (point-min) (point-max) "notmuch insert")) > > this takes advantage of message-send-mail-hook's late-send. as the > documentation for that var says: > > This hook is run very late -- just before the message is sent as > mail. > > But this isn't something normal users should need to do manually. > > Any emacs gurus want to propose a way to improve the situation? i'm at > a bit of a loss.
Not an "emacs guru". However... Currently our fcc processing is run (in a slightly weird way by rebinding message-do-fcc) just before message-sent-hook. This has the potentially important semantics that it only runs for messages that are successfully sent. There is a variable message-encoded-mail-cache, which holds the raw sent message. We should probably use this instead of doing our own re-encoding (mml-generate-mime does the actual mime stuff, and is called from message-encode-message-body. Larsi added this variable to gnus after we copied and modified message-do-fcc. The change _looks_ relatively simple, guarding the call to message-encode-message-body as follows: ;; Avoid re-doing things like GPG-encoding secret parts. (if (not encoded-cache) (message-encode-message-body) (erase-buffer) (insert encoded-cache)) _______________________________________________ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org