X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/838023d469054cc19d0a2b7cf48e39082d8220f0..c456627ffaf4e73e979883b56117cb91f164936b:/lisp/autorevert.el diff --git a/lisp/autorevert.el b/lisp/autorevert.el index f0c12d2d97..bc9d58e1a0 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -1,8 +1,8 @@ ;;; autorevert.el --- revert buffers when files on disk change -*- lexical-binding:t -*- -;; Copyright (C) 1997-1999, 2001-2015 Free Software Foundation, Inc. +;; Copyright (C) 1997-1999, 2001-2016 Free Software Foundation, Inc. -;; Author: Anders Lindgren +;; Author: Anders Lindgren ;; Keywords: convenience ;; Created: 1997-06-01 ;; Date: 1999-11-30 @@ -664,8 +664,8 @@ This is an internal function used by Auto-Revert Mode." (not (eq revert 'fast))) (message "Reverting buffer `%s'." (buffer-name))) ;; If point (or a window point) is at the end of the buffer, we - ;; want to keep it at the end after reverting. This allows to - ;; tail a file. + ;; want to keep it at the end after reverting. This allows one + ;; to tail a file. (when buffer-file-name (setq eob (eobp)) (walk-windows @@ -680,7 +680,10 @@ This is an internal function used by Auto-Revert Mode." ;; not to forget that. This gives undesirable results when ;; the file's mode changes, but that is less common. (let ((buffer-read-only buffer-read-only)) - (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes))) + ;; Bug#23276: When the file has been deleted, keep the + ;; buffer unchanged. + (ignore-errors + (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes)))) (when buffer-file-name (when eob (goto-char (point-max))) (dolist (window eoblist) @@ -688,7 +691,7 @@ This is an internal function used by Auto-Revert Mode." ;; `preserve-modes' avoids changing the (minor) modes. But we do ;; want to reset the mode for VC, so we do it manually. (when (or revert auto-revert-check-vc-info) - (vc-find-file-hook)))) + (vc-refresh-state)))) (defun auto-revert-tail-handler (size) (let ((modified (buffer-modified-p))