diff --git a/lisp/fileloop.el b/lisp/fileloop.el index 2e77811a57..b07b81bc1e 100644 --- a/lisp/fileloop.el +++ b/lisp/fileloop.el @@ -213,5 +213,28 @@ fileloop-initialize-replace (lambda () (perform-replace from to t t delimited nil multi-query-replace-map)))) +;;;###autoload +(defun fileloop-search-in-project (regexp) + "Search for REGEXP in all the files of the project. +Stops when a match is found. +To continue searching for next match, use command \\[fileloop-continue]." + (interactive "sSearch (regexp): ") + (fileloop-initialize-search + regexp (project-files (project-current t)) 'default) + (fileloop-continue)) + +;;;###autoload +(defun fileloop-query-replace-in-project (from to) + "Search for REGEXP in all the files of the project. +Stops when a match is found. +To continue searching for next match, use command \\[fileloop-continue]." + (interactive + (pcase-let ((`(,from ,to) + (query-replace-read-args "Query replace (regexp)" t t))) + (list from to))) + (fileloop-initialize-replace + from to (project-files (project-current t)) 'default) + (fileloop-continue)) + (provide 'fileloop) ;;; fileloop.el ends here diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index fbf761c60c..e526249d48 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -519,30 +519,5 @@ project--completing-read-strict inherit-input-method))) (concat common-parent-directory res))) -(declare-function fileloop-continue "fileloop" ()) - -;;;###autoload -(defun project-search (regexp) - "Search for REGEXP in all the files of the project. -Stops when a match is found. -To continue searching for next match, use command \\[fileloop-continue]." - (interactive "sSearch (regexp): ") - (fileloop-initialize-search - regexp (project-files (project-current t)) 'default) - (fileloop-continue)) - -;;;###autoload -(defun project-query-replace (from to) - "Search for REGEXP in all the files of the project. -Stops when a match is found. -To continue searching for next match, use command \\[fileloop-continue]." - (interactive - (pcase-let ((`(,from ,to) - (query-replace-read-args "Query replace (regexp)" t t))) - (list from to))) - (fileloop-initialize-replace - from to (project-files (project-current t)) 'default) - (fileloop-continue)) - (provide 'project) ;;; project.el ends here