From: Leo Liu <sdl.web@gmail.com>
To: Glenn Morris <rgm@gnu.org>
Cc: 13152@debbugs.gnu.org
Subject: bug#13152: 24.2.90; [REGRESSION] dired-get-marked-files changed
Date: Wed, 09 Jan 2013 19:07:57 +0800 [thread overview]
Message-ID: <m27gnmwr5e.fsf@gmail.com> (raw)
In-Reply-To: <oqvcb7cngf.fsf@fencepost.gnu.org> (Glenn Morris's message of "Tue, 08 Jan 2013 17:35:44 -0500")
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
next prev parent reply other threads:[~2013-01-09 11:07 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-12 2:23 bug#13152: 24.2.90; [REGRESSION] dired-get-marked-files changed Leo
2012-12-12 2:47 ` Glenn Morris
2012-12-12 5:30 ` Leo
2012-12-12 8:13 ` Glenn Morris
2012-12-12 9:29 ` Juri Linkov
2012-12-12 11:32 ` Leo
2012-12-12 23:11 ` Juri Linkov
2012-12-13 1:20 ` Leo
2012-12-14 0:46 ` Juri Linkov
2012-12-14 3:05 ` Leo
2012-12-14 10:26 ` martin rudalics
2012-12-14 10:43 ` Leo
2012-12-14 10:58 ` martin rudalics
2012-12-14 10:26 ` martin rudalics
2012-12-15 10:59 ` Juri Linkov
2013-01-04 3:49 ` Leo Liu
2013-01-04 3:46 ` Leo Liu
2013-01-04 7:08 ` martin rudalics
2013-01-07 2:38 ` Leo Liu
2013-01-07 7:43 ` martin rudalics
2013-01-08 11:02 ` Leo Liu
2013-01-08 22:27 ` Glenn Morris
2013-01-08 22:35 ` Glenn Morris
2013-01-09 1:15 ` Leo Liu
2013-01-09 11:07 ` Leo Liu [this message]
2013-01-10 0:50 ` Juri Linkov
2013-01-10 1:04 ` Leo Liu
2013-01-18 18:40 ` Leo Liu
2013-01-09 1:19 ` Leo Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m27gnmwr5e.fsf@gmail.com \
--to=sdl.web@gmail.com \
--cc=13152@debbugs.gnu.org \
--cc=rgm@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).