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, 23 May 2021 00:06:23 +0300 Organization: LINKOV.NET Message-ID: <87v97amq2s.fsf@mail.linkov.net> References: <87v97j1xih.fsf@mail.linkov.net> <87v97en1tm.fsf@mail.linkov.net> <87cztkuede.fsf@mail.linkov.net> <87r1hz3l4u.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36540"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 48456@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 22 23:15:21 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 1lkYxt-0009Mb-Np for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 May 2021 23:15:21 +0200 Original-Received: from localhost ([::1]:53342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkYxs-0006kY-Qx for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 May 2021 17:15:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkYxa-0006kQ-TM for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 17:15:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkYxa-0008CZ-MP for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 17:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lkYxa-0003as-EW for bug-gnu-emacs@gnu.org; Sat, 22 May 2021 17:15: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, 22 May 2021 21:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48456 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 48456-submit@debbugs.gnu.org id=B48456.162171804513726 (code B ref 48456); Sat, 22 May 2021 21:15:02 +0000 Original-Received: (at 48456) by debbugs.gnu.org; 22 May 2021 21:14:05 +0000 Original-Received: from localhost ([127.0.0.1]:40167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkYwf-0003ZJ-6C for submit@debbugs.gnu.org; Sat, 22 May 2021 17:14:05 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:60713) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkYwd-0003Yh-6T for 48456@debbugs.gnu.org; Sat, 22 May 2021 17:14:03 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id C7046240002; Sat, 22 May 2021 21:13:55 +0000 (UTC) In-Reply-To: <87r1hz3l4u.fsf@tcd.ie> (Basil L. Contovounesios's message of "Fri, 21 May 2021 21:08:33 +0100") 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:207067 Archived-At: > Test dired-test-bug30624 condition: > (ert-test-failed > ((should > (dired-do-create-files 'copy 'dired-copy-file "Copy" nil)) > :form > (dired-do-create-files copy dired-copy-file "Copy" nil) > :value nil)) > > Should the 'should' be removed? AFAICT the return value of > dired-do-create-files is unspecified (and unused). It's hard to guess how important the return value was. It seems the return value of dired-do-create-files via dired-create-files and via dired-move-to-filename was the position of the beginning of the filename, or nil if none found. If it should be preserved, then dired-do-create-files could be changed to something like this: (prog1 (dired-create-files ... (when (or (eq dired-do-revert-buffer t) ... Otherwise, the 'should' should be replaced with diff --git a/test/lisp/dired-aux-tests.el b/test/lisp/dired-aux-tests.el index 7f1743f88d..1fd14e72aa 100644 --- a/test/lisp/dired-aux-tests.el +++ b/test/lisp/dired-aux-tests.el @@ -109,7 +109,8 @@ dired-test-bug30624 (progn (dired-revert) (dired-mark-files-regexp "bug30624_file") - (should (dired-do-create-files 'copy 'dired-copy-file "Copy" nil))) + (dired-do-create-files 'copy 'dired-copy-file "Copy" nil) + (should (dired-move-to-filename))) (delete-directory target-dir 'recursive) (mapc #'delete-file `(,file1 ,file2)) (kill-buffer buf)))))