emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/el-search d54491c 147/332: Add a FILE argument to `el-s


From: Stefan Monnier
Subject: [elpa] externals/el-search d54491c 147/332: Add a FILE argument to `el-search-dired-marked-files'
Date: Tue, 1 Dec 2020 15:48:31 -0500 (EST)

branch: externals/el-search
commit d54491ce4778d98c20643d4dc799876840b6d61e
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Michael Heerdegen <michael_heerdegen@web.de>

    Add a FILE argument to `el-search-dired-marked-files'
    
    Make `el-search-dired-marked-files' accept the list of marked files as
    an argument and compute the list in the interactive spec instead of
    the body so that repeating the command from the history works as
    expected (i.e. uses the same file list).
---
 el-search.el | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/el-search.el b/el-search.el
index e9bd684..0bda729 100644
--- a/el-search.el
+++ b/el-search.el
@@ -1815,22 +1815,23 @@ are ignored."
 (declare-function dired-get-marked-files "dired")
 
 ;;;###autoload
-(defun el-search-dired-marked-files (pattern &optional recursively)
+(defun el-search-dired-marked-files (pattern files &optional recursively)
   "El-search marked files and directories in dired.
 With RECURSIVELY given (the prefix arg in an interactive call),
 search directories recursively."
-  (interactive (list (el-search--read-pattern-for-interactive) 
current-prefix-arg))
+  (interactive (list (el-search--read-pattern-for-interactive)
+                     (dired-get-marked-files)
+                     current-prefix-arg))
   (el-search-setup-search
    pattern
-   (let ((files (dired-get-marked-files)))
-     (lambda ()
-       (stream-concatenate
-        (seq-map
-         (lambda (file)
-           (if (file-directory-p file)
-               (el-search-stream-of-directory-files file recursively)
-             (stream (list file))))
-         (stream files)))))))
+   (lambda ()
+     (stream-concatenate
+      (seq-map
+       (lambda (file)
+         (if (file-directory-p file)
+             (el-search-stream-of-directory-files file recursively)
+           (stream (list file))))
+       (stream files))))))
 
 
 ;;;; Query-replace



reply via email to

[Prev in Thread] Current Thread [Next in Thread]