From: Manuel Giraud Date: Mon, 17 Jun 2024 09:06:28 +0000 (+0200) Subject: Prevent auto-revert when deleting entry (bug#71264) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=651d451e95f2ed0babe74ea2fce6dbb67959a020;p=emacs.git 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) --- 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))