GNU bug report logs -
#13152
24.2.90; [REGRESSION] dired-get-marked-files changed
Previous Next
Reported by: Leo <sdl.web <at> gmail.com>
Date: Wed, 12 Dec 2012 02:25:01 UTC
Severity: minor
Found in version 24.2.90
Done: Leo Liu <sdl.web <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #82 received at 13152 <at> debbugs.gnu.org (full text, mbox):
On 2013-01-09 06:35 +0800, Glenn Morris wrote:
> Maybe you can just make dired-get-marked-files throw an explicit error
> "Not in Dired mode" unless (derived-mode-p 'dired-mode), though I still
> don't see what the big deal is here. You would need to check ever caller
> to make sure this did not break anything.
After looking at this function more closely, I am reluctant to put in a
(derived-mode-p 'dired-mode) check since all the related functions work
more generally (using regexps) and do not depend on mode checking.
So I propose the following patch instead which avoids returning values
such as (nil) or (t nil). What do you think? - Leo
diff --git a/lisp/dired.el b/lisp/dired.el
index b62b4d1a..2f7d5b37 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -620,12 +620,14 @@ (defun dired-get-marked-files (&optional localp arg filter distinguish-one-marke
If DISTINGUISH-ONE-MARKED is non-nil, then if we find just one marked file,
return (t FILENAME) instead of (FILENAME).
Don't use that together with FILTER."
- (let* ((all-of-them
- (save-excursion
- (dired-map-over-marks
- (dired-get-filename localp 'no-error-if-not-filep)
- arg nil distinguish-one-marked)))
- result)
+ (let ((all-of-them
+ (save-excursion
+ (delq nil (dired-map-over-marks
+ (dired-get-filename localp 'no-error-if-not-filep)
+ arg nil distinguish-one-marked))))
+ result)
+ (when (equal all-of-them '(t))
+ (setq all-of-them nil))
(if (not filter)
(if (and distinguish-one-marked (eq (car all-of-them) t))
all-of-them
This bug report was last modified 12 years and 130 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.