feat: allow users to programmatically call quick-find-files
Some checks failed
CI / build (emacs-26-alpine-ci-eask) (push) Failing after 5s
CI / build (emacs-27-alpine-ci-eask) (push) Failing after 3s
CI / build (emacs-28-alpine-ci-eask) (push) Failing after 21s
CI / build (emacs-29-alpine-ci-eask) (push) Failing after 18s
CI / build (emacs-master-alpine-ci-eask) (push) Failing after 20s

This commit is contained in:
Lucien Cartier-Tilet 2023-12-29 13:47:08 +01:00
parent f3e6987ccd
commit 3907a31632
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -148,7 +148,7 @@ Return a list of paths to files."
quick-find-files-dirs-and-exts))) quick-find-files-dirs-and-exts)))
;;;###autoload ;;;###autoload
(defun quick-find-files(&optional arg) (defun quick-find-files (&optional arg dir ext)
"Quickly find and open files in directories with specific extensions. "Quickly find and open files in directories with specific extensions.
Directories in which to look for files with specific extensions Directories in which to look for files with specific extensions
@ -159,13 +159,12 @@ user for the root directory of their search and the file
extention they are looking for. When the file extension is left extention they are looking for. When the file extension is left
empty, all files are to be looked for." empty, all files are to be looked for."
(interactive "P") (interactive "P")
(let (dir ext)
(when arg (when arg
(setq dir (read-file-name "Root directory: ")) (setq dir (read-file-name "Root directory: "))
(setq ext (read-string "File extension (leave blank for all files): "))) (setq ext (read-string "File extension (leave blank for all files): ")))
(find-file (funcall quick-find-files-completing-read (find-file (funcall quick-find-files-completing-read
"Open file: " "Open file: "
(quick-find-files-list-files dir ext))))) (quick-find-files-list-files dir ext))))
; Provides ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Provides ;;;;;;;;;;;;;;;;;;;;;;;;;;;;