GNU bug report logs - #79042
29.4; dired-get-marked-files docstring is incorrect

Previous Next

Package: emacs;

Reported by: Sean McAfee <eefacm <at> gmail.com>

Date: Thu, 17 Jul 2025 20:49:02 UTC

Severity: normal

Found in version 29.4

Done: Eli Zaretskii <eliz <at> gnu.org>

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sean McAfee <eefacm <at> gmail.com>
Cc: 79042 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#79042: 29.4; dired-get-marked-files docstring is incorrect
Date: Sat, 19 Jul 2025 13:06:36 +0300
> Cc: "79042 <at> debbugs.gnu.org" <79042 <at> debbugs.gnu.org>
> From: Sean McAfee <eefacm <at> gmail.com>
> Date: Fri, 18 Jul 2025 12:01:20 -0700
> 
> On Fri, Jul 18, 2025 at 9:27 AM Drew Adams <drew.adams <at> oracle.com> wrote:
> 
>  >> It's not a doc bug, it's a product bug - a regression
>  >> introduced in Emacs 29.  In prior versions it works
>  >> as the doc says: (dired-get-marked-files nil 'marked)
>  >> returns the file name on the current line.
>  >
>  > Wait, so dired-get-marked-files isn't supposed to be able to 
>  > distinguish between a single explicitly marked file and no files 
>  > being marked?  But that's information that I need.
>  > How do I get it, if not with dired-get-marked-files?

You could call dired-get-marked-files with nil ARG and then with ARG
equal to 'marked', and compare the results.

>  Mea culpa.  I shouldn't have said the Emacs 29+ behavior
>  of recognizing a special `marked' value for ARG is a bug.
>  (It's maybe not the best way to allow that behavior, but
>  it's OK.)
> 
> I understood, I'm just astonished that the current behavior is
> considered a bug, since it seems so useful.  Is there a
> compelling reason not to allow dired-get-marked-files to
> return nil when no files are explicitly marked, when it's
> given a special distinguished value for ARG?  It's a
> pattern that's used in many other places.

The previous behavior wasn't a bug.  The new special value of 'marked'
was introduced in support of the new user option
dired-mouse-drag-files, which needs to distinguish between the two
cases.  Since the special value 'marked' is new in Emacs 29, and used
only in a couple of places, I don't understand why you are saying that
it's "a pattern that's used in many other places".  How could that be
true?  Is there perhaps a misunderstanding here?  What are the
specific practical problems you encountered with this new feature?

Your original report said:

> For context, I was looking for a way to get a list of marked files, or
> nil if no files are explicitly marked.  The docstring for
> dired-get-marked-files does not admit such a usage, but it actually is
> possible, as described above.

This is explicitly possible using this new value.  So I'm not sure
what other issues did you have in this regard.

In any case, I've updated (on the emacs-30 release branch) the doc
strings of the relevant functions with the effect of the special value
'marked'.  I think this is all we need to do in this bug.




This bug report was last modified 24 days ago.

Previous Next


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