diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 66347e7b584..3b4907b8f43 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))