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))))
;;;###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.
Uses the first available search backend from `+helm-project-search-engines'. If
ALL-FILES-P (universal argument), include all files, even hidden or compressed
ones, in the search."
ARG (universal argument), include all files, even hidden or compressed ones, in
the search."
(interactive "P")
(funcall (or (+helm--get-command "+helm/%s")
#'+helm/grep)
arg
query))
initial-query
directory))
;;;###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.
Uses the first available search backend from `+helm-project-search-engines'. If
ALL-FILES-P (universal argument), include all files, even hidden or compressed
ones."
ARG (universal argument), include all files, even hidden or compressed ones."
(interactive "P")
(funcall (or (+helm--get-command "+helm/%s-from-cwd")
#'+helm/grep-from-cwd)
arg
query))
initial-query
directory))
;; Relative to project root

View file

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