[PATCH] Use `without-restriction` in `with-temporary-notmuch-message-buffer`

Subject: [PATCH] Use `without-restriction` in `with-temporary-notmuch-message-buffer`

Date: Thu, 14 Mar 2024 16:03:15 +0100

To: Carl Worth, notmuch@notmuchmail.org

Cc:

From: Marc Fargas


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 | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 5102078..fdced98 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -148,11 +148,12 @@ Otherwise set it according to `notmuch-fcc-dirs'."
   `(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
+       (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.43.2

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

Thread: