# HG changeset patch # User Richard M. Stallman # Date 937601857 0 # Node ID 4e71424cd40be383ad780a3e782e9560d53a0a97 # Parent bb28bbb732db7c3a947eb6c41e12457770b13cf7 (after-find-file): When visiting a backup file, make it read-only. diff -r bb28bbb732db -r 4e71424cd40b lisp/files.el --- a/lisp/files.el Fri Sep 17 19:43:09 1999 +0000 +++ b/lisp/files.el Fri Sep 17 20:57:37 1999 +0000 @@ -1189,7 +1189,7 @@ (msg (cond ((and error (file-attributes buffer-file-name)) (setq buffer-read-only t) - "File exists, but cannot be read.") + "File exists, but cannot be read") ((not buffer-read-only) (if (and warn (file-newer-than-file-p (make-auto-save-file-name) @@ -1216,6 +1216,10 @@ (or not-serious (sit-for 1 nil t))))) (if (and auto-save-default (not noauto)) (auto-save-mode t))) + ;; Make people do a little extra work (C-x C-q) + ;; before altering a backup file. + (if (backup-file-name-p buffer-file-name) + (setq buffer-read-only t)) (if nomodes nil (and view-read-only view-mode