aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-05-20 05:27:50 +0000
committerRichard M. Stallman1997-05-20 05:27:50 +0000
commitdb8c4866b438ebb6204f179137445c360e50c3fb (patch)
tree78bc5448ca497726d4ff0f9eb5618a6e5a5e78f6
parentf209429d373b00f9c7b3edfe86e1f156debe96f9 (diff)
downloademacs-db8c4866b438ebb6204f179137445c360e50c3fb.tar.gz
emacs-db8c4866b438ebb6204f179137445c360e50c3fb.zip
(path-separator, parse-colon-path): Doc fixes.
(revert-without-query): Renamed from find-file-revert-without-query. (find-file-noselect): Use new option. (revert-buffer): Check the option here too.
-rw-r--r--lisp/files.el18
1 files changed, 13 insertions, 5 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 4d0e17b48f6..55ae970c5dd 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -146,12 +146,12 @@ both at the file level and at the levels of the containing directories."
146 :type 'boolean 146 :type 'boolean
147 :group 'find-file) 147 :group 'find-file)
148 148
149(defcustom find-file-revert-without-query 149(defcustom revert-without-query
150 nil 150 nil
151 "*Specify which files should be reverted without query. 151 "*Specify which files should be reverted without query.
152The value is a list of regular expressions. 152The value is a list of regular expressions.
153If the file name matches one of these regular expressions, 153If the file name matches one of these regular expressions,
154then `find-file' reverts the file without querying 154then `revert-buffer' reverts the file without querying
155if the file has changed on disk and you have not edited the buffer." 155if the file has changed on disk and you have not edited the buffer."
156 :type 'boolean 156 :type 'boolean
157 :group 'find-file) 157 :group 'find-file)
@@ -366,10 +366,10 @@ with a definition that really does change some file names."
366Not actually set up until the first time you you use it.") 366Not actually set up until the first time you you use it.")
367 367
368(defvar path-separator ":" 368(defvar path-separator ":"
369 "Character used to separate concatenated paths.") 369 "Character used to separate directories in search paths.")
370 370
371(defun parse-colon-path (cd-path) 371(defun parse-colon-path (cd-path)
372 "Explode a colon-separated list of paths into a string list." 372 "Explode a colon-separated search path into a list of directory names."
373 (and cd-path 373 (and cd-path
374 (let (cd-prefix cd-list (cd-start 0) cd-colon) 374 (let (cd-prefix cd-list (cd-start 0) cd-colon)
375 (setq cd-path (concat cd-path path-separator)) 375 (setq cd-path (concat cd-path path-separator))
@@ -879,7 +879,7 @@ Optional second arg RAWFILE non-nil means the file is read literally"
879 ;; Certain files should be reverted automatically 879 ;; Certain files should be reverted automatically
880 ;; if they have changed on disk and not in the buffer. 880 ;; if they have changed on disk and not in the buffer.
881 ((and (not (buffer-modified-p buf)) 881 ((and (not (buffer-modified-p buf))
882 (let ((tail find-file-revert-without-query) 882 (let ((tail revert-without-query)
883 (found nil)) 883 (found nil))
884 (while tail 884 (while tail
885 (if (string-match (car tail) filename) 885 (if (string-match (car tail) filename)
@@ -2446,6 +2446,14 @@ non-nil, it is called instead of rereading visited file contents."
2446 (cond ((null file-name) 2446 (cond ((null file-name)
2447 (error "Buffer does not seem to be associated with any file")) 2447 (error "Buffer does not seem to be associated with any file"))
2448 ((or noconfirm 2448 ((or noconfirm
2449 (and (not (buffer-modified-p))
2450 (let ((tail revert-without-query)
2451 (found nil))
2452 (while tail
2453 (if (string-match (car tail) file-name)
2454 (setq found t))
2455 (setq tail (cdr tail)))
2456 found))
2449 (yes-or-no-p (format "Revert buffer from file %s? " 2457 (yes-or-no-p (format "Revert buffer from file %s? "
2450 file-name))) 2458 file-name)))
2451 (run-hooks 'before-revert-hook) 2459 (run-hooks 'before-revert-hook)