GNU bug report logs - #79293
[PATCH] Pass dired default filenames via defaults argument

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Fri, 22 Aug 2025 21:21:01 UTC

Severity: normal

Tags: patch

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Full log


Message #26 received at 79293 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Spencer Baugh <sbaugh <at> janestreet.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 79293 <at> debbugs.gnu.org
Subject: Re: bug#79293: [PATCH] Pass dired default filenames via defaults
 argument
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.




This bug report was last modified 22 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.