]> git.eshelyaron.com Git - emacs.git/commitdiff
Prevent auto-revert when deleting entry (bug#71264)
authorManuel Giraud <manuel@ledu-giraud.fr>
Mon, 17 Jun 2024 09:06:28 +0000 (11:06 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 22 Jun 2024 15:39:31 +0000 (17:39 +0200)
* 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

index 1b6433c6541a1296d8594bb42cbd5926b5177904..b1e643059ad083545cfd627114432abac4020a6c 100644 (file)
@@ -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))