branch: externals/compat
commit 91f25b356e2903d2179926992a9546ddcede9afb
Author: Philip Kaludercic <[email protected]>
Commit: Philip Kaludercic <[email protected]>
Add compat-dired-get-marked-files
---
MANUAL | 3 +++
compat-27.el | 18 ++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/MANUAL b/MANUAL
index 7402ddbec4..74f3185bb3 100644
--- a/MANUAL
+++ b/MANUAL
@@ -322,6 +322,9 @@ when ~compat-27~ is required:
- Function: compat-executable-find :: [[info:elisp#Locating Files][(elisp)
Locating Files]].
Handle the optional second (REMOTE) argument.
+- Function: compat-dired-get-marked-files :: Defined in ~dired.el~
+
+ Handles the optional fifth (ERROR) argument.
Compat does not provide support for the following Lisp features
implemented in 27.1:
diff --git a/compat-27.el b/compat-27.el
index 9b37f3c36a..42f39a3ebe 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -548,5 +548,23 @@ The return value is a string (or nil in case we can’t find
it)."
(or (lm-header "package-version")
(lm-header "version")))))))))
+
+;;;; Defined in dired.el
+
+(declare-function
+ dired-get-marked-files "dired.el"
+ (&optional localp arg filter distinguish-one-marked error))
+
+;;* UNTESTED
+(compat-defun dired-get-marked-files
+ (&optional localp arg filter distinguish-one-marked error)
+ "Return the marked files’ names as list of strings."
+ :feature 'dired
+ :prefix t
+ (let ((result (dired-get-marked-files localp arg filter
distinguish-one-marked)))
+ (if (and (null result) error)
+ (user-error (if (stringp error) error "No files specified"))
+ result)))
+
(provide 'compat-27)
;;; compat-27.el ends here