From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#48456: Revert Dired after copy/rename Date: Sun, 16 May 2021 00:45:58 +0300 Organization: LINKOV.NET Message-ID: <87v97j1xih.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29037"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) To: 48456@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 15 23:49:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1li29m-0007Rn-6m for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 May 2021 23:49:10 +0200 Original-Received: from localhost ([::1]:48536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1li29l-0001ID-8i for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 May 2021 17:49:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1li29e-0001Hp-H7 for bug-gnu-emacs@gnu.org; Sat, 15 May 2021 17:49:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37822) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1li29e-000325-9z for bug-gnu-emacs@gnu.org; Sat, 15 May 2021 17:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1li29e-0000ce-81 for bug-gnu-emacs@gnu.org; Sat, 15 May 2021 17:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 May 2021 21:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48456 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16211153212362 (code B ref -1); Sat, 15 May 2021 21:49:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 May 2021 21:48:41 +0000 Original-Received: from localhost ([127.0.0.1]:49368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1li29J-0000c2-HI for submit@debbugs.gnu.org; Sat, 15 May 2021 17:48:41 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:49526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1li29I-0000bv-2h for submit@debbugs.gnu.org; Sat, 15 May 2021 17:48:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1li29H-0000p2-Qi for bug-gnu-emacs@gnu.org; Sat, 15 May 2021 17:48:39 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:46233) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1li29F-0002hs-Rs for bug-gnu-emacs@gnu.org; Sat, 15 May 2021 17:48:39 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 2E0251C0004 for ; Sat, 15 May 2021 21:48:31 +0000 (UTC) Received-SPF: pass client-ip=217.70.183.197; envelope-from=juri@linkov.net; helo=relay5-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:206624 Archived-At: --=-=-= Content-Type: text/plain 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=dired-do-create-files-revert-buffer.patch 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. --=-=-=--