all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tino Calancha <f92capac@gmail.com>
To: 22892@debbugs.gnu.org
Subject: bug#22892: 25.1.50; dired-get-marked-files distinguish marks
Date: Thu, 3 Mar 2016 18:36:56 +0900 (JST)	[thread overview]
Message-ID: <alpine.LRH.2.20.1603031834200.25062@calancha-ilc.kek.jp> (raw)

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]


* lisp/dired.el(dired-get-marked-files):

Added optional argument `marker-char'. If non-nil,
the files retrieved are those marked with MARKER-CHAR.
Otherwise the returned files are those marked with
`dired-marker-char'.

Callers are not affected: the arg is optional and
added at the end of the parameter list.



In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.29)
  of 2016-03-03 built on calancha-pc
Repository revision: 887f6126c5ce9084f93083765ac026ca6b28175c

[-- Attachment #2: Type: text/plain, Size: 1976 bytes --]

diff --git a/lisp/dired.el b/lisp/dired.el
index 6c7445c..b69e611 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -627,7 +627,7 @@ dired-map-over-marks
      ;; save-excursion loses, again
      (dired-move-to-filename)))
 
-(defun dired-get-marked-files (&optional localp arg filter distinguish-one-marked)
+(defun dired-get-marked-files (&optional localp arg filter distinguish-one-marked marker-char)
   "Return the marked files' names as list of strings.
 The list is in the same order as the buffer, that is, the car is the
   first marked file.
@@ -644,22 +644,26 @@ dired-get-marked-files
 
 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
-	   (delq nil (dired-map-over-marks
-		      (dired-get-filename localp 'no-error-if-not-filep)
-		      arg nil distinguish-one-marked))))
-	result)
+Don't use that together with FILTER.
+
+Optional arg MARKER-CHAR, if non-nil, then it is the marker
+char to search. Otherwise `dired-marker-char' is used."
+  (let* ((dired-marker-char (or marker-char dired-marker-char))
+         (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
-	  (nreverse all-of-them))
+    (if (and distinguish-one-marked (eq (car all-of-them) t))
+        all-of-them
+      (nreverse all-of-them))
       (dolist (file all-of-them)
-	(if (funcall filter file)
-	    (push file result)))
+    (if (funcall filter file)
+        (push file result)))
       result)))
 \f
 ;; The dired command

             reply	other threads:[~2016-03-03  9:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03  9:36 Tino Calancha [this message]
2016-03-04 12:34 ` bug#22892: 25.1.50; dired-get-marked-files distinguish marks Lars Ingebrigtsen
2016-03-05 13:13   ` Tino Calancha

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.20.1603031834200.25062@calancha-ilc.kek.jp \
    --to=f92capac@gmail.com \
    --cc=22892@debbugs.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.