aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorTassilo Horn2025-01-20 16:21:24 +0100
committerTassilo Horn2025-01-20 17:54:02 +0100
commit40d5ff01e51ed6319933e18df0fbe9ef55d9bece (patch)
tree28e1ed8c9fd5fea0b6f798ccb7938ca69f4022e3 /lisp
parentb568ff418ce7147c27d7f82fe4a8eef325b9de2c (diff)
downloademacs-40d5ff01e51ed6319933e18df0fbe9ef55d9bece.tar.gz
emacs-40d5ff01e51ed6319933e18df0fbe9ef55d9bece.zip
Don't skip or double-process files in dired with auto-revert-mode (bug#75626)
* lisp/dired.el (dired--inhibit-auto-revert): New variable. (dired-map-over-marks): Make the generated code bind it. (dired-buffer-stale-p): Return nil if dired--inhibit-auto-revert is non-nil.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/dired.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 2087a6f6f21..d2071d80bf3 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -944,6 +944,9 @@ Return value is the number of files marked, or nil if none were marked."
944 "")))) 944 ""))))
945 (and (> count 0) count))) 945 (and (> count 0) count)))
946 946
947(defvar-local dired--inhibit-auto-revert nil
948 "A non-nil value prevents `auto-revert-mode' from reverting the buffer.")
949
947(defmacro dired-map-over-marks (body arg &optional show-progress 950(defmacro dired-map-over-marks (body arg &optional show-progress
948 distinguish-one-marked) 951 distinguish-one-marked)
949 "Eval BODY with point on each marked line. Return a list of BODY's results. 952 "Eval BODY with point on each marked line. Return a list of BODY's results.
@@ -980,7 +983,9 @@ marked file, return (t FILENAME) instead of (FILENAME)."
980 ;;endless loop. 983 ;;endless loop.
981 ;;This warning should not apply any longer, sk 2-Sep-1991 14:10. 984 ;;This warning should not apply any longer, sk 2-Sep-1991 14:10.
982 `(prog1 985 `(prog1
983 (let ((inhibit-read-only t) case-fold-search found results) 986 (let ((dired--inhibit-auto-revert t)
987 (inhibit-read-only t)
988 case-fold-search found results)
984 (if (and ,arg (not (eq ,arg 'marked))) 989 (if (and ,arg (not (eq ,arg 'marked)))
985 (if (integerp ,arg) 990 (if (integerp ,arg)
986 (progn ;; no save-excursion, want to move point. 991 (progn ;; no save-excursion, want to move point.
@@ -1289,6 +1294,12 @@ This feature is used by Auto Revert mode."
1289 ;; Do not auto-revert when the dired buffer can be currently 1294 ;; Do not auto-revert when the dired buffer can be currently
1290 ;; written by the user as in `wdired-mode'. 1295 ;; written by the user as in `wdired-mode'.
1291 buffer-read-only 1296 buffer-read-only
1297 ;; When a dired operation using dired-map-over-marks is in
1298 ;; progress, dired--inhibit-auto-revert is bound to some
1299 ;; non-nil value and we must not auto-revert because that could
1300 ;; change the order of files leading to skipping or
1301 ;; double-processing (see bug#75626).
1302 (not dired--inhibit-auto-revert)
1292 (dired-directory-changed-p dirname)))) 1303 (dired-directory-changed-p dirname))))
1293 1304
1294(defcustom dired-auto-revert-buffer nil 1305(defcustom dired-auto-revert-buffer nil