Subject: Re: bug#79293: [PATCH] Pass dired default filenames via defaults argument

From: Juri Linkov <[email-masked]>
Date: Sun, 24 Aug 2025 20:25:21 +0300

> Before my change:
>
> 1. C-x C-f ~/
> 2. R (or Y or H)
> 3. M-n
> 4. Observe the minibuffer starts with /home/user
>
> After my change:
>
> 1. C-x C-f ~/
> 2. R (or Y or H)
> 3. M-n
> 4. Observe the minibuffer starts with ~/ as usual for read-file-name
>
> Juri may also have some comments about why the code was written in this
> way, as the original author of both this code and other code in dired
> which uses minibuffer-with-setup-hook.

It was just a common coding pattern shared between all similar functions:

  (minibuffer-with-setup-hook
      (lambda ()
        (setq-local minibuffer-default-add-function nil)
        (setq minibuffer-default defaults))

But when one function uses another like 'dired-do-create-files'
using 'read-file-name', it's fine to pass the default list
via its argument.