Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
1312bfc6
Commit
1312bfc6
authored
Mar 29, 2002
by
Richard M. Stallman
Browse files
(dired-get-marked-files): New arg FILTER allows selection of some files.
parent
d88c92eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
lisp/dired.el
lisp/dired.el
+18
-8
No files found.
lisp/dired.el
View file @
1312bfc6
...
@@ -397,18 +397,28 @@ BODY should not be too long as it is expanded four times."
...
@@ -397,18 +397,28 @@ BODY should not be too long as it is expanded four times."
;; save-excursion loses, again
;; save-excursion loses, again
(dired-move-to-filename)))
(dired-move-to-filename)))
(defun dired-get-marked-files (&optional localp arg)
(defun dired-get-marked-files (&optional localp arg
filter
)
"Return the marked files' names as list of strings.
"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
The list is in the same order as the buffer, that is, the car is the
first marked file.
first marked file.
Values returned are normally absolute
path
names.
Values returned are normally absolute
file
names.
Optional arg LOCALP as in `dired-get-filename'.
Optional arg LOCALP as in `dired-get-filename'.
Optional second argument ARG forces to use other files. If ARG is an
Optional second argument ARG specifies files near point
integer, use the next ARG files. If ARG is otherwise non-nil, use
instead of marked files. If ARG is an integer, use the next ARG files.
current file. Usually ARG comes from the current prefix arg."
If ARG is otherwise non-nil, use file. Usually ARG comes from
(save-excursion
the command's prefix arg.
(nreverse (dired-map-over-marks (dired-get-filename localp) arg))))
Optional third argument FILTER, if non-nil, is a function to select
some of the files--those for which (funcall FILTER FILENAME) is non-nil."
(let ((all-of-them
(save-excursion
(dired-map-over-marks (dired-get-filename localp) arg)))
result)
(if (not filter)
(nreverse all-of-them)
(dolist (file all-of-them)
(if (funcall filter file)
(push file result)))
result)))
;; Function dired-ls is redefinable for VMS, ange-ftp, Prospero or
;; Function dired-ls is redefinable for VMS, ange-ftp, Prospero or
;; other special applications.
;; other special applications.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment