comparison lisp/files.el @ 988:5df795348f45

[xemacs-hg @ 2002-09-01 22:13:52 by andyp] apply various 21.4 patches
author andyp
date Sun, 01 Sep 2002 22:14:58 +0000
parents 42375619fa45
children ccaf90c5a53a
comparison
equal deleted inserted replaced
987:7ffc86e44409 988:5df795348f45
2827 (interactive (list (not current-prefix-arg))) 2827 (interactive (list (not current-prefix-arg)))
2828 (if revert-buffer-function 2828 (if revert-buffer-function
2829 (funcall revert-buffer-function ignore-auto noconfirm) 2829 (funcall revert-buffer-function ignore-auto noconfirm)
2830 (let* ((opoint (point)) 2830 (let* ((opoint (point))
2831 (newbuf nil) 2831 (newbuf nil)
2832 (found nil)
2832 (delay-prompt nil) 2833 (delay-prompt nil)
2833 (auto-save-p (and (not ignore-auto) 2834 (auto-save-p (and (not ignore-auto)
2834 (recent-auto-save-p) 2835 (recent-auto-save-p)
2835 buffer-auto-save-file-name 2836 buffer-auto-save-file-name
2836 (file-readable-p buffer-auto-save-file-name) 2837 (file-readable-p buffer-auto-save-file-name)
2841 buffer-file-name))) 2842 buffer-file-name)))
2842 (cond ((null file-name) 2843 (cond ((null file-name)
2843 (error "Buffer does not seem to be associated with any file")) 2844 (error "Buffer does not seem to be associated with any file"))
2844 ((or noconfirm 2845 ((or noconfirm
2845 (and (not (buffer-modified-p)) 2846 (and (not (buffer-modified-p))
2846 (let (found) 2847 (dolist (rx revert-without-query found)
2847 (dolist (rx revert-without-query found) 2848 (when (string-match rx file-name)
2848 (when (string-match rx file-name) 2849 (setq found t))))
2849 (setq found t)))))
2850 ;; If we might perform an optimized revert then we 2850 ;; If we might perform an optimized revert then we
2851 ;; want to delay prompting in case we don't need to 2851 ;; want to delay prompting in case we don't need to
2852 ;; do it at all 2852 ;; do it at all
2853 (and (not auto-save-p) 2853 (and (not auto-save-p)
2854 (not (buffer-modified-p)) 2854 (not (buffer-modified-p))
2860 ;; has changed. 2860 ;; has changed.
2861 (cond ((or auto-save-p 2861 (cond ((or auto-save-p
2862 (buffer-modified-p) 2862 (buffer-modified-p)
2863 (and (setq newbuf (revert-buffer-internal 2863 (and (setq newbuf (revert-buffer-internal
2864 file-name)) 2864 file-name))
2865 (or noconfirm 2865 (or noconfirm found
2866 (and delay-prompt 2866 (and delay-prompt
2867 (yes-or-no-p 2867 (yes-or-no-p
2868 (format "Revert buffer from file %s? " 2868 (format "Revert buffer from file %s? "
2869 file-name)))))) 2869 file-name))))))
2870 ;; If file was backed up but has changed since, 2870 ;; If file was backed up but has changed since,