master c9da3c1a5ed: 'insert-directory': Make 'ls' error buffer read-only

Stephen Berman via Mailing list for Emacs changes <[email protected]>
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: master
commit c9da3c1a5edaf2812c87358947dccc0d7336e93e
Author: Filipp Gunbin <[email protected]>
Commit: Stephen Berman <[email protected]>

    'insert-directory': Make 'ls' error buffer read-only
    
    * lisp/files.el (insert-directory): Set 'buffer-read-only' to t
    for buffer "*ls error*", since it is only an informational buffer,
    and let-bind 'inhibit-read-only' to t to write any 'ls' error
    message to it (bug#80499, Message #230 and followups).
---
 lisp/files.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index 97144fef78f..149a3e80866 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -8488,8 +8488,10 @@ normally equivalent short `-D' option is just passed on to
           (defvar dired--ls-error-buffer) ; Pacify byte-compiler.
           (let ((errbuf (get-buffer-create "*ls error*")))
             (with-current-buffer errbuf
-              (erase-buffer)
-              (insert-file-contents errfile))
+              (setq buffer-read-only t)
+              (let ((inhibit-read-only t))
+                (erase-buffer)
+                (insert-file-contents errfile)))
             (setq dired--ls-error-buffer errbuf)))
         (defvar dired--ls-error-file) ; Pacify byte-compiler.
         (setq dired--ls-error-file errfile)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.