[PATCH v2 1/2] Replace `without-restriction` with `save-restriction`

Subject: [PATCH v2 1/2] Replace `without-restriction` with `save-restriction`

Date: Mon, 17 Jun 2024 21:28:24 +0200

To: notmuch@notmuchmail.org

Cc: Michael J Gruber

From: michaeljgruber+grubix+git@gmail.com


From: Michael J Gruber <git@grubix.eu>

37c022ae ("Use `without-restriction` in `with-temporary-notmuch-message-buffer`", 2024-03-14)
introduced a fix for draft saving in a way which is supported on Emacs
29 and above only. Replace this with a construct which we have used
before, so that we keep the same compatibility level.
---
unchanged

 emacs/notmuch-maildir-fcc.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index cf50e855..c7b403cf 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -145,7 +145,8 @@ 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."
-  `(without-restriction
+  `(save-restriction
+     (widen)
      (let ((case-fold-search t)
 	   (buf (current-buffer))
 	   (mml-externalize-attachments message-fcc-externalize-attachments))
-- 
2.45.2.749.g54362de8d7

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

Thread: