From 2fc71e3c45e521a062ea2ab17a4cfe19c3c6f941 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Sat, 19 Jan 2013 02:35:44 +0800 Subject: [PATCH] Prune erroneous values in dired-get-marked-files Fixes: debbugs:13152 --- lisp/ChangeLog | 5 +++++ lisp/dired.el | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cd7a013d55c..7be8224ae65 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-01-18 Leo Liu + + * dired.el (dired-get-marked-files): Prune erroneous values due to + last change. (Bug#13152) + 2013-01-17 Glenn Morris * progmodes/etags.el (tags-table-check-computed-list): diff --git a/lisp/dired.el b/lisp/dired.el index 3d01c7b0924..76809f992cc 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -620,12 +620,14 @@ Optional third argument FILTER, if non-nil, is a function to select 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 -- 2.11.4.GIT