Fix wrong-num-of-args error on SPC *

Adds QUERY and DIRECTORY args to +{ivy,helm}/project-search
This commit is contained in:
Henrik Lissner 2019-04-14 13:36:56 -04:00
parent 94a2bc77ef
commit b6611d215f
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 20 additions and 16 deletions

View file

@ -178,30 +178,31 @@ order.
return (intern (format format tool)))) return (intern (format format tool))))
;;;###autoload ;;;###autoload
(defun +helm/project-search (&optional arg query) (defun +helm/project-search (&optional arg initial-query directory)
"Performs a project search from the project root. "Performs a project search from the project root.
Uses the first available search backend from `+helm-project-search-engines'. If Uses the first available search backend from `+helm-project-search-engines'. If
ALL-FILES-P (universal argument), include all files, even hidden or compressed ARG (universal argument), include all files, even hidden or compressed ones, in
ones, in the search." the search."
(interactive "P") (interactive "P")
(funcall (or (+helm--get-command "+helm/%s") (funcall (or (+helm--get-command "+helm/%s")
#'+helm/grep) #'+helm/grep)
arg arg
query)) initial-query
directory))
;;;###autoload ;;;###autoload
(defun +helm/project-search-from-cwd (&optional arg query) (defun +helm/project-search-from-cwd (&optional arg initial-query directory)
"Performs a project search recursively from the current directory. "Performs a project search recursively from the current directory.
Uses the first available search backend from `+helm-project-search-engines'. If Uses the first available search backend from `+helm-project-search-engines'. If
ALL-FILES-P (universal argument), include all files, even hidden or compressed ARG (universal argument), include all files, even hidden or compressed ones."
ones."
(interactive "P") (interactive "P")
(funcall (or (+helm--get-command "+helm/%s-from-cwd") (funcall (or (+helm--get-command "+helm/%s-from-cwd")
#'+helm/grep-from-cwd) #'+helm/grep-from-cwd)
arg arg
query)) initial-query
directory))
;; Relative to project root ;; Relative to project root

View file

@ -350,28 +350,31 @@ order.
return (intern (format format tool)))) return (intern (format format tool))))
;;;###autoload ;;;###autoload
(defun +ivy/project-search (&optional all-files-p) (defun +ivy/project-search (&optional arg initial-query directory)
"Performs a project search from the project root. "Performs a project search from the project root.
Uses the first available search backend from `+ivy-project-search-engines'. If Uses the first available search backend from `+ivy-project-search-engines'. If
ALL-FILES-P (universal argument), include all files, even hidden or compressed ARG (universal argument), include all files, even hidden or compressed ones, in
ones, in the search." the search."
(interactive "P") (interactive "P")
(funcall (or (+ivy--get-command "+ivy/%s") (funcall (or (+ivy--get-command "+ivy/%s")
#'+ivy/grep) #'+ivy/grep)
(or all-files-p current-prefix-arg))) arg
initial-query
directory))
;;;###autoload ;;;###autoload
(defun +ivy/project-search-from-cwd (&optional all-files-p) (defun +ivy/project-search-from-cwd (&optional arg initial-query directory)
"Performs a project search recursively from the current directory. "Performs a project search recursively from the current directory.
Uses the first available search backend from `+ivy-project-search-engines'. If Uses the first available search backend from `+ivy-project-search-engines'. If
ALL-FILES-P (universal argument), include all files, even hidden or compressed ARG (universal argument), include all files, even hidden or compressed ones."
ones."
(interactive "P") (interactive "P")
(funcall (or (+ivy--get-command "+ivy/%s-from-cwd") (funcall (or (+ivy--get-command "+ivy/%s-from-cwd")
#'+ivy/grep-from-cwd) #'+ivy/grep-from-cwd)
(or all-files-p current-prefix-arg))) arg
initial-query
directory))
;; Relative to project root ;; Relative to project root