diff options
| author | David Bremner <david@tethera.net> | 2022-01-19 23:22:07 -0400 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2022-01-26 07:22:09 -0400 |
| commit | da302e1cbaaab89b2bbb32c0f59e1aa6ee708455 (patch) | |
| tree | 10494ed1360a2630fbbaaacaa8844e520e5ae824 /emacs | |
| parent | 8179c3d1146b6b19c64200f0617c4a1ba7588569 (diff) | |
emacs: use cached encoded copy for fcc
This fixes the bug reported by dkg in [1]. The movement of the call to
n-m-setup-message-for-saving is so the cleanup of Fcc headers happens
in the encoded version (otherwise Fcc headers may be saved to disk).
[1]: id:87k1zm225v.fsf@fifthhorseman.net
Diffstat (limited to 'emacs')
| -rw-r--r-- | emacs/notmuch-maildir-fcc.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el index 7e177bf7..51020788 100644 --- a/emacs/notmuch-maildir-fcc.el +++ b/emacs/notmuch-maildir-fcc.el @@ -149,6 +149,7 @@ Otherwise set it according to `notmuch-fcc-dirs'." (buf (current-buffer)) (mml-externalize-attachments message-fcc-externalize-attachments)) (with-current-buffer (get-buffer-create " *message temp*") + (message-clone-locals buf) ;; for message-encoded-mail-cache (erase-buffer) (insert-buffer-substring buf) ,@body))) @@ -158,7 +159,10 @@ Otherwise set it according to `notmuch-fcc-dirs'." This should be called on a temporary copy. This is taken from the function message-do-fcc." - (message-encode-message-body) + (if (not message-encoded-mail-cache) + (message-encode-message-body) + (erase-buffer) + (insert message-encoded-mail-cache)) (save-restriction (message-narrow-to-headers) (mail-encode-encoded-word-buffer)) @@ -179,12 +183,12 @@ This is a rearranged version of message mode's message-do-fcc." (setq file (message-fetch-field "fcc" t))) (when file (with-temporary-notmuch-message-buffer + (notmuch-maildir-setup-message-for-saving) (save-restriction (message-narrow-to-headers) (while (setq file (message-fetch-field "fcc" t)) (push file files) (message-remove-header "fcc" nil t))) - (notmuch-maildir-setup-message-for-saving) ;; Process FCC operations. (mapc #'notmuch-fcc-handler files) (kill-buffer (current-buffer))))))) |
