GNU bug report logs - #916
23.0.60; doc string of dired-get-marked-files

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Sun, 7 Sep 2008 17:25:05 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 916 in the body.
You can then email your comments to 916 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#916; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <emacs-pretest-bug <at> gnu.org>
Subject: 23.0.60; doc string of dired-get-marked-files
Date: Sun, 7 Sep 2008 10:17:10 -0700
The doc string says this about optional arg ARG:
 
Optional second argument arg specifies files near point
 instead of marked files.  If arg is an integer, use the next arg files.
  If arg is otherwise non-nil, use file.  Usually arg comes from
  the command's prefix arg.
 
This is not correct, or at least it is incomplete. It says that the
current file is used if ARG is non-nil but not an integer, which is
true, but it suggests that no file is used if ARG is nil. That is, the
entire ARG description suggests that a singleton list of the current
file is returned only when ARG is non-nil. It suggests that if ARG is
nil then the empty list is returnedl.
 
In fact, if ARG is nil, the current file is used. That is,
(dired-get-marked-files) in Dired returns the singleton list of the
file where the cursor is. This behavior is not a bug; it is the doc
string that is incomplete by not covering this case.
 
The doc string should say something like this regarding ARG:
 
Optional second argument arg specifies files near point instead of
 marked files.  If arg is an integer, use the next arg files.
 Otherwise, use the file on the current line.  Usually arg comes from
 the command's prefix arg.
 
`dired-get-marked-files' uses `dired-map-over-marks', and the doc
string of that function correctly states "If no marked file could be
found, execute body on the current line."
 
 
 
In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
 of 2008-08-29 on LENNART-69DE564
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include
-fno-crossjumping'
 





Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to "Drew Adams" <drew.adams <at> oracle.com>:
bug acknowledged by developer. Full text and rfc822 format available.

Message #10 received at 916-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 916-done <at> debbugs.gnu.org
Subject: Re: 23.0.60; doc string of dired-get-marked-files
Date: Wed, 22 Oct 2008 16:39:40 -0400
> The doc string says this about optional arg ARG:
> 
> Optional second argument arg specifies files near point
>  instead of marked files.  If arg is an integer, use the next arg files.
>   If arg is otherwise non-nil, use file.  Usually arg comes from
>   the command's prefix arg.
> 
> This is not correct, or at least it is incomplete.

It is correct, because of the word "instead": if ARG is non-nil, it
modifies the behavior of the function.

I fixed the doc string to make this distinction clearer, and to prevent
similar confusion.




bug archived. Request was from Debbugs Internal Request <don <at> donarmstrong.com> to internal_control <at> emacsbugs.donarmstrong.com. (Thu, 20 Nov 2008 15:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 213 days ago.

Previous Next


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