diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2018-05-14 17:09:18 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2018-05-14 17:09:18 +0200 |
commit | 63b506eb4c4194fc0910b77ea1c4211658b781e1 (patch) | |
tree | 5ee632b87b02a2cf49da295c73162f1950a93f28 /lisp | |
parent | 8fe07bbe310beea1c51b8f59c9fbac5fc466913b (diff) | |
download | emacs-63b506eb4c4194fc0910b77ea1c4211658b781e1.tar.gz |
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.el | 10 |
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." (not (eq (car attributes) t)) (equal (nth 5 attributes) modtime))))) +(defvar auto-revert-remote-files) + (defun dired-buffer-stale-p (&optional noconfirm) "Return non-nil if current Dired buffer needs updating. -If NOCONFIRM is non-nil, then this function always returns nil -for a remote directory. This feature is used by Auto Revert mode." +If NOCONFIRM is non-nil, then this function returns nil for a +remote directory, unless `auto-revert-remote-files' is non-nil. +This feature is used by Auto Revert mode." (let ((dirname (if (consp dired-directory) (car dired-directory) dired-directory))) (and (stringp dirname) - (not (when noconfirm (file-remote-p dirname))) + (not (when noconfirm (and (not auto-revert-remote-files) + (file-remote-p dirname)))) (file-readable-p dirname) ;; Do not auto-revert when the dired buffer can be currently ;; written by the user as in `wdired-mode'. |