From ca5099a0e0a558b60f7ed8fe565ca4a267ec8cd6 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 5 Oct 2024 09:15:46 +0800 Subject: [PATCH] work-buffer--release: Bind inhibit-read-only * lisp/emacs-lisp/subr-x.el (work-buffer--release): Bind inhibit-read-only while erasing the buffer. (cherry picked from commit 069ecc9c4c3709246a6ff50d09af418444d427c3) --- lisp/emacs-lisp/subr-x.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 4cdb065feeb..5b47deb880e 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -357,7 +357,8 @@ automatically killed, which means that in a such case ;; Flush BUFFER before making it available again, i.e. clear ;; its contents, remove all overlays and buffer-local ;; variables. Is it enough to safely reuse the buffer? - (erase-buffer) + (let ((inhibit-read-only t)) + (erase-buffer)) (delete-all-overlays) (let (change-major-mode-hook) (kill-all-local-variables t)) -- 2.39.2