GNU bug report logs -
#48456
Revert Dired after copy/rename
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Sat, 15 May 2021 21:49:02 UTC
Severity: normal
Tags: fixed
Fixed in version 28.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
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:
[dired-do-create-files-revert-buffer.patch (text/x-diff, inline)]
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.
This bug report was last modified 3 years and 358 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.