Subject: Re: bug#48456: Revert Dired after copy/rename

From: "Basil L. Contovounesios" <[email-masked]>
Date: Mon, 24 May 2021 12:04:14 +0100

Juri Linkov <[email-masked]> writes:

>>   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)))))

Either (as well as ignoring the unspecified return value) sounds fine to
me.  CCing Tino for comment.

Thanks,

-- 
Basil