summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1992-09-24 07:23:59 +0000
committerRichard M. Stallman <rms@gnu.org>1992-09-24 07:23:59 +0000
commit8cfb9d4630abc99aa39b448958cb530882e7a1da (patch)
tree3babb66f9f03d3956e8b06f39119aeceff530080 /lisp/files.el
parent9c79dd1b203d66a6a3f2227c22667a5ab5dbb290 (diff)
downloademacs-8cfb9d4630abc99aa39b448958cb530882e7a1da.tar.gz
(after-find-file): New arg NOAUTO.
(revert-buffer, recover-file): Pass t for that arg.
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 32b21ca91e8..c98ea0ce7a0 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -425,12 +425,13 @@ The buffer is not selected, just returned to the caller."
(after-find-file error (not nowarn))))
buf)))
-(defun after-find-file (&optional error warn)
+(defun after-find-file (&optional error warn noauto)
"Called after finding a file and by the default revert function.
Sets buffer mode, parses local variables.
-Optional args ERROR and WARN: ERROR non-nil means there was an
+Optional args ERROR, WARN, and NOAUTO: ERROR non-nil means there was an
error in reading the file. WARN non-nil means warn if there
exists an auto-save file more recent than the visited file.
+NOAUTO means don't mess with auto-save mode.
Finishes by calling the functions in `find-file-hooks'."
(setq buffer-read-only (not (file-writable-p buffer-file-name)))
(if noninteractive
@@ -470,7 +471,7 @@ Finishes by calling the functions in `find-file-hooks'."
(progn
(message msg)
(or not-serious (sit-for 1 nil t)))))
- (if auto-save-default
+ (if (and auto-save-default (not noauto))
(auto-save-mode t)))
(normal-mode t)
(mapcar 'funcall find-file-hooks))
@@ -1281,7 +1282,7 @@ do the work."
(erase-buffer))
(insert-file-contents file-name (not auto-save-p))))
(goto-char (min opoint (point-max)))
- (after-find-file nil)
+ (after-find-file nil nil t)
t)))))
(defun recover-file (file)
@@ -1313,7 +1314,7 @@ do the work."
(let ((buffer-read-only nil))
(erase-buffer)
(insert-file-contents file-name nil))
- (after-find-file nil))
+ (after-find-file nil nil t))
(t (error "Recover-file cancelled.")))))
(defun kill-some-buffers ()