From 651d451e95f2ed0babe74ea2fce6dbb67959a020 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. (cherry picked from commit 11fb3510f48f3eeeca0bf5622c028c5138ba50f3) --- lisp/dired.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/dired.el b/lisp/dired.el index 1b6433c6541..b1e643059ad 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) @@ -4003,7 +4004,11 @@ non-empty directories is allowed." (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.39.2