bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48456: Revert Dired after copy/rename


From: Juri Linkov
Subject: bug#48456: Revert Dired after copy/rename
Date: Sun, 16 May 2021 00:45:58 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

This has been a problem for a long time.
Every time after copying a file to another directory,
there is a need to switch to the Dired buffer with the copied file,
and revert it manually by typing 'g' to restore the correct sorting order,
because the copied file is inserted where point was located, but not
where it should be according to the Dired sorting order.

This patch reverts the target buffer only when dired-auto-revert-buffer
is customized to t:

diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 8fce402c7a..12064d27d9 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -2117,7 +2117,9 @@ dired-do-create-files
           (lambda (from)
             (expand-file-name (file-name-nondirectory from) target))
         (lambda (_from) target))
-       marker-char))))
+       marker-char)
+      (when (eq dired-auto-revert-buffer t)
+        (dired-fun-in-all-buffers target nil #'revert-buffer)))))
 
 ;; Read arguments for a marked-files command that wants a file name,
 ;; perhaps popping up the list of marked files.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]