aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1992-09-24 07:23:59 +0000
committerRichard M. Stallman1992-09-24 07:23:59 +0000
commit8cfb9d4630abc99aa39b448958cb530882e7a1da (patch)
tree3babb66f9f03d3956e8b06f39119aeceff530080
parent9c79dd1b203d66a6a3f2227c22667a5ab5dbb290 (diff)
downloademacs-8cfb9d4630abc99aa39b448958cb530882e7a1da.tar.gz
emacs-8cfb9d4630abc99aa39b448958cb530882e7a1da.zip
(after-find-file): New arg NOAUTO.
(revert-buffer, recover-file): Pass t for that arg.
-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."
425 (after-find-file error (not nowarn)))) 425 (after-find-file error (not nowarn))))
426 buf))) 426 buf)))
427 427
428(defun after-find-file (&optional error warn) 428(defun after-find-file (&optional error warn noauto)
429 "Called after finding a file and by the default revert function. 429 "Called after finding a file and by the default revert function.
430Sets buffer mode, parses local variables. 430Sets buffer mode, parses local variables.
431Optional args ERROR and WARN: ERROR non-nil means there was an 431Optional args ERROR, WARN, and NOAUTO: ERROR non-nil means there was an
432error in reading the file. WARN non-nil means warn if there 432error in reading the file. WARN non-nil means warn if there
433exists an auto-save file more recent than the visited file. 433exists an auto-save file more recent than the visited file.
434NOAUTO means don't mess with auto-save mode.
434Finishes by calling the functions in `find-file-hooks'." 435Finishes by calling the functions in `find-file-hooks'."
435 (setq buffer-read-only (not (file-writable-p buffer-file-name))) 436 (setq buffer-read-only (not (file-writable-p buffer-file-name)))
436 (if noninteractive 437 (if noninteractive
@@ -470,7 +471,7 @@ Finishes by calling the functions in `find-file-hooks'."
470 (progn 471 (progn
471 (message msg) 472 (message msg)
472 (or not-serious (sit-for 1 nil t))))) 473 (or not-serious (sit-for 1 nil t)))))
473 (if auto-save-default 474 (if (and auto-save-default (not noauto))
474 (auto-save-mode t))) 475 (auto-save-mode t)))
475 (normal-mode t) 476 (normal-mode t)
476 (mapcar 'funcall find-file-hooks)) 477 (mapcar 'funcall find-file-hooks))
@@ -1281,7 +1282,7 @@ do the work."
1281 (erase-buffer)) 1282 (erase-buffer))
1282 (insert-file-contents file-name (not auto-save-p)))) 1283 (insert-file-contents file-name (not auto-save-p))))
1283 (goto-char (min opoint (point-max))) 1284 (goto-char (min opoint (point-max)))
1284 (after-find-file nil) 1285 (after-find-file nil nil t)
1285 t))))) 1286 t)))))
1286 1287
1287(defun recover-file (file) 1288(defun recover-file (file)
@@ -1313,7 +1314,7 @@ do the work."
1313 (let ((buffer-read-only nil)) 1314 (let ((buffer-read-only nil))
1314 (erase-buffer) 1315 (erase-buffer)
1315 (insert-file-contents file-name nil)) 1316 (insert-file-contents file-name nil))
1316 (after-find-file nil)) 1317 (after-find-file nil nil t))
1317 (t (error "Recover-file cancelled."))))) 1318 (t (error "Recover-file cancelled.")))))
1318 1319
1319(defun kill-some-buffers () 1320(defun kill-some-buffers ()