aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus2018-05-14 17:09:18 +0200
committerMichael Albinus2018-05-14 17:09:18 +0200
commit63b506eb4c4194fc0910b77ea1c4211658b781e1 (patch)
tree5ee632b87b02a2cf49da295c73162f1950a93f28 /lisp
parent8fe07bbe310beea1c51b8f59c9fbac5fc466913b (diff)
downloademacs-63b506eb4c4194fc0910b77ea1c4211658b781e1.tar.gz
emacs-63b506eb4c4194fc0910b77ea1c4211658b781e1.zip
Improve `dired-buffer-stale-p' for remote files
* lisp/dired.el (dired-buffer-stale-p): Check for ´file-remote-p' only if `auto-revert-remote-files' is non-nil.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/dired.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 1c283c5de3f..41b46d463a2 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -850,14 +850,18 @@ If DIRNAME is already in a Dired buffer, that buffer is used without refresh."
850 (not (eq (car attributes) t)) 850 (not (eq (car attributes) t))
851 (equal (nth 5 attributes) modtime))))) 851 (equal (nth 5 attributes) modtime)))))
852 852
853(defvar auto-revert-remote-files)
854
853(defun dired-buffer-stale-p (&optional noconfirm) 855(defun dired-buffer-stale-p (&optional noconfirm)
854 "Return non-nil if current Dired buffer needs updating. 856 "Return non-nil if current Dired buffer needs updating.
855If NOCONFIRM is non-nil, then this function always returns nil 857If NOCONFIRM is non-nil, then this function returns nil for a
856for a remote directory. This feature is used by Auto Revert mode." 858remote directory, unless `auto-revert-remote-files' is non-nil.
859This feature is used by Auto Revert mode."
857 (let ((dirname 860 (let ((dirname
858 (if (consp dired-directory) (car dired-directory) dired-directory))) 861 (if (consp dired-directory) (car dired-directory) dired-directory)))
859 (and (stringp dirname) 862 (and (stringp dirname)
860 (not (when noconfirm (file-remote-p dirname))) 863 (not (when noconfirm (and (not auto-revert-remote-files)
864 (file-remote-p dirname))))
861 (file-readable-p dirname) 865 (file-readable-p dirname)
862 ;; Do not auto-revert when the dired buffer can be currently 866 ;; Do not auto-revert when the dired buffer can be currently
863 ;; written by the user as in `wdired-mode'. 867 ;; written by the user as in `wdired-mode'.