From 48efd572e6b8e6d214fc8b4e7b28f001fc13345a Mon Sep 17 00:00:00 2001 From: Marc Fargas Date: Thu, 14 Mar 2024 15:56:49 +0100 Subject: [PATCH] Use `without-restriction` in `with-temporary-notmuch-message-buffer` This ensures that the temporary copy of the current message-mode buffer is whole and not limited by a current restriction. An example of such restriction is the default one established by message-mode when composing a reply, that hides the References, In-Reply-To and similar headers. --- emacs/notmuch-maildir-fcc.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el index 5102078..cf50e85 100644 --- a/emacs/notmuch-maildir-fcc.el +++ b/emacs/notmuch-maildir-fcc.el @@ -145,14 +145,15 @@ Otherwise set it according to `notmuch-fcc-dirs'." (defmacro with-temporary-notmuch-message-buffer (&rest body) "Set-up a temporary copy of the current message-mode buffer." - `(let ((case-fold-search t) - (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))) + `(without-restriction + (let ((case-fold-search t) + (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)))) (defun notmuch-maildir-setup-message-for-saving () "Setup message for saving. -- 2.44.0