*** files.el Wed Feb 1 10:17:44 2006 --- files.el Tue Feb 7 20:23:42 2006 *************** *** 3791,3803 **** confirmation.) Optional third argument PRESERVE-MODES non-nil means don't alter ! the files modes. Normally we reinitialize them using `normal-mode'. If the value of `revert-buffer-function' is non-nil, it is called to do all the work for this command. Otherwise, the hooks `before-revert-hook' and `after-revert-hook' are run at the beginning and the end, and if `revert-buffer-insert-file-contents-function' is ! non-nil, it is called instead of rereading visited file contents." ;; I admit it's odd to reverse the sense of the prefix argument, but ;; there is a lot of code out there which assumes that the first --- 3791,3803 ---- confirmation.) Optional third argument PRESERVE-MODES non-nil means don't alter ! the file's modes. Normally we reinitialize them using `normal-mode'. If the value of `revert-buffer-function' is non-nil, it is called to do all the work for this command. Otherwise, the hooks `before-revert-hook' and `after-revert-hook' are run at the beginning and the end, and if `revert-buffer-insert-file-contents-function' is ! non-nil, it is called instead of rereading the visited file's contents." ;; I admit it's odd to reverse the sense of the prefix argument, but ;; there is a lot of code out there which assumes that the first *************** *** 3823,3835 **** (error "Buffer does not seem to be associated with any file")) ((or noconfirm (and (not (buffer-modified-p)) ! (let ((tail revert-without-query) ! (found nil)) ! (while tail ! (if (string-match (car tail) file-name) ! (setq found t)) ! (setq tail (cdr tail))) ! found)) (yes-or-no-p (format "Revert buffer from file %s? " file-name))) (run-hooks 'before-revert-hook) --- 3823,3832 ---- (error "Buffer does not seem to be associated with any file")) ((or noconfirm (and (not (buffer-modified-p)) ! (catch 'found ! (dolist (regexp revert-without-query) ! (when (string-match regexp file-name) ! (throw 'found t))))) (yes-or-no-p (format "Revert buffer from file %s? " file-name))) (run-hooks 'before-revert-hook) *************** *** 3838,3887 **** (and (not auto-save-p) (not (verify-visited-file-modtime (current-buffer))) (setq buffer-backed-up nil)) - ;; Get rid of all undo records for this buffer. - (or (eq buffer-undo-list t) - (setq buffer-undo-list nil)) ;; Effectively copy the after-revert-hook status, ;; since after-find-file will clobber it. (let ((global-hook (default-value 'after-revert-hook)) (local-hook-p (local-variable-p 'after-revert-hook)) (local-hook (and (local-variable-p 'after-revert-hook) ! after-revert-hook))) ! (let (buffer-read-only ! ;; Don't make undo records for the reversion. ! (buffer-undo-list t)) ! (if revert-buffer-insert-file-contents-function ! (funcall revert-buffer-insert-file-contents-function ! file-name auto-save-p) ! (if (not (file-exists-p file-name)) ! (error (if buffer-file-number ! "File %s no longer exists!" ! "Cannot revert nonexistent file %s") ! file-name)) ! ;; Bind buffer-file-name to nil ! ;; so that we don't try to lock the file. ! (let ((buffer-file-name nil)) ! (or auto-save-p ! (unlock-buffer))) ! (widen) ! (let ((coding-system-for-read ! ;; Auto-saved file shoule be read by Emacs' ! ;; internal coding. ! (if auto-save-p 'auto-save-coding ! (or coding-system-for-read ! buffer-file-coding-system-explicit)))) ! ;; This force after-insert-file-set-coding ! ;; (called from insert-file-contents) to set ! ;; buffer-file-coding-system to a proper value. ! (kill-local-variable 'buffer-file-coding-system) ! ! ;; Note that this preserves point in an intelligent way. ! (if preserve-modes ! (let ((buffer-file-format buffer-file-format)) ! (insert-file-contents file-name (not auto-save-p) ! nil nil t)) ! (insert-file-contents file-name (not auto-save-p) ! nil nil t))))) ;; Recompute the truename in case changes in symlinks ;; have changed the truename. (setq buffer-file-truename --- 3835,3886 ---- (and (not auto-save-p) (not (verify-visited-file-modtime (current-buffer))) (setq buffer-backed-up nil)) ;; Effectively copy the after-revert-hook status, ;; since after-find-file will clobber it. (let ((global-hook (default-value 'after-revert-hook)) (local-hook-p (local-variable-p 'after-revert-hook)) (local-hook (and (local-variable-p 'after-revert-hook) ! after-revert-hook)) ! (inhibit-read-only t)) ! (cond ! (revert-buffer-insert-file-contents-function ! (unless (eq buffer-undo-list t) ! ;; Get rid of all undo records for this buffer. ! (setq buffer-undo-list nil)) ! ;; Don't make undo records for the reversion. ! (let ((buffer-undo-list t)) ! (funcall revert-buffer-insert-file-contents-function ! file-name auto-save-p))) ! ((not (file-exists-p file-name)) ! (error (if buffer-file-number ! "File %s no longer exists!" ! "Cannot revert nonexistent file %s") ! file-name)) ! (t ! ;; Bind buffer-file-name to nil ! ;; so that we don't try to lock the file. ! (let ((buffer-file-name nil)) ! (or auto-save-p ! (unlock-buffer))) ! (widen) ! (let ((coding-system-for-read ! ;; Auto-saved file should be read by Emacs' ! ;; internal coding. ! (if auto-save-p 'auto-save-coding ! (or coding-system-for-read ! buffer-file-coding-system-explicit)))) ! ;; This force after-insert-file-set-coding ! ;; (called from insert-file-contents) to set ! ;; buffer-file-coding-system to a proper value. ! (kill-local-variable 'buffer-file-coding-system) ! ! ;; Note that this preserves point in an intelligent way. ! (if preserve-modes ! (let ((buffer-file-format buffer-file-format)) ! (insert-file-contents file-name (not auto-save-p) ! nil nil t)) ! (insert-file-contents file-name (not auto-save-p) ! nil nil t))))) ;; Recompute the truename in case changes in symlinks ;; have changed the truename. (setq buffer-file-truename