From b4b3e32a7f1375ff228bc25311a56062d64aa049 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Mon, 17 Jun 2024 11:06:28 +0200 Subject: [PATCH] Prevent auto-revert when deleting entry(bug#71264) * lisp/dired.el (require): Require "autorevert" for `auto-revert-mode' usage. (dired-internal-do-deletions): Temporarily prevent auto-revert. --- lisp/dired.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/dired.el b/lisp/dired.el index c51e5e42c29..0adf06f471e 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -36,6 +36,7 @@ (eval-when-compile (require 'subr-x)) (eval-when-compile (require 'cl-lib)) +(eval-when-compile (require 'autorevert)) ;; When bootstrapping dired-loaddefs has not been generated. (require 'dired-loaddefs nil t) (require 'dnd) @@ -4015,7 +4016,11 @@ dired-internal-do-deletions (dired-move-to-filename) (let ((inhibit-read-only t)) (condition-case err - (let ((fn (car (car l)))) + (let ((fn (car (car l))) + ;; Temporarily prevent auto-revert while + ;; deleting entry in the dired buffer + ;; (bug#71264). + (auto-revert-mode nil)) (dired-delete-file fn dired-recursive-deletes trash) ;; if we get here, removing worked (setq succ (1+ succ)) -- 2.45.2