all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: 48456@debbugs.gnu.org
Subject: bug#48456: Revert Dired after copy/rename
Date: Sun, 16 May 2021 00:45:58 +0300	[thread overview]
Message-ID: <87v97j1xih.fsf@mail.linkov.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: dired-do-create-files-revert-buffer.patch --]
[-- Type: text/x-diff, Size: 569 bytes --]

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	other threads:[~2021-05-15 21:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-15 21:45 Juri Linkov [this message]
2021-05-19 16:18 ` bug#48456: Revert Dired after copy/rename Juri Linkov
2021-05-21 18:32   ` Juri Linkov
2021-05-21 20:08     ` Basil L. Contovounesios
2021-05-22 21:06       ` Juri Linkov
2021-05-24 11:04         ` Basil L. Contovounesios

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v97j1xih.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=48456@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.