From: Sean Whitton Date: Sat, 5 Oct 2024 01:15:46 +0000 (+0800) Subject: work-buffer--release: Bind inhibit-read-only X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ca5099a0e0a558b60f7ed8fe565ca4a267ec8cd6;p=emacs.git 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) --- 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))