rm unnecessary calls to projectile-project-p
This commit is contained in:
parent
e200bce2ff
commit
499bc4cc23
1 changed files with 77 additions and 83 deletions
|
|
@ -609,7 +609,6 @@ additional options to be passed to grep, or an alternative git
|
||||||
grep command. It is read from the minibuffer if the function is
|
grep command. It is read from the minibuffer if the function is
|
||||||
called with a prefix argument."
|
called with a prefix argument."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (projectile-project-p)
|
|
||||||
(if (and (eq (projectile-project-vcs) 'git)
|
(if (and (eq (projectile-project-vcs) 'git)
|
||||||
projectile-use-git-grep)
|
projectile-use-git-grep)
|
||||||
(let ((counsel-prompt-function
|
(let ((counsel-prompt-function
|
||||||
|
|
@ -652,8 +651,7 @@ called with a prefix argument."
|
||||||
:unwind (lambda ()
|
:unwind (lambda ()
|
||||||
(counsel-delete-process)
|
(counsel-delete-process)
|
||||||
(swiper--cleanup))
|
(swiper--cleanup))
|
||||||
:caller 'counsel-projectile-grep)))
|
:caller 'counsel-projectile-grep))))
|
||||||
(user-error "You're not in a project")))
|
|
||||||
|
|
||||||
(counsel-set-async-exit-code 'counsel-projectile-grep 1 "No matches found")
|
(counsel-set-async-exit-code 'counsel-projectile-grep 1 "No matches found")
|
||||||
(ivy-set-occur 'counsel-projectile-grep 'counsel-projectile-grep-occur)
|
(ivy-set-occur 'counsel-projectile-grep 'counsel-projectile-grep-occur)
|
||||||
|
|
@ -672,7 +670,6 @@ OPTIONS, if non-nil, is a string containing additional options to
|
||||||
be passed to ag. It is read from the minibuffer if the function
|
be passed to ag. It is read from the minibuffer if the function
|
||||||
is called with a prefix argument."
|
is called with a prefix argument."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (projectile-project-p)
|
|
||||||
(let* ((ignored (mapconcat (lambda (i)
|
(let* ((ignored (mapconcat (lambda (i)
|
||||||
(concat "--ignore "
|
(concat "--ignore "
|
||||||
(shell-quote-argument i)
|
(shell-quote-argument i)
|
||||||
|
|
@ -689,8 +686,7 @@ is called with a prefix argument."
|
||||||
(counsel-ag (eval counsel-projectile-ag-initial-input)
|
(counsel-ag (eval counsel-projectile-ag-initial-input)
|
||||||
(projectile-project-root)
|
(projectile-project-root)
|
||||||
options
|
options
|
||||||
(projectile-prepend-project-name "ag")))
|
(projectile-prepend-project-name "ag"))))
|
||||||
(user-error "You're not in a project")))
|
|
||||||
|
|
||||||
;;; counsel-projectile-rg
|
;;; counsel-projectile-rg
|
||||||
|
|
||||||
|
|
@ -705,7 +701,6 @@ OPTIONS, if non-nil, is a string containing additional options to
|
||||||
be passed to rg. It is read from the minibuffer if the function
|
be passed to rg. It is read from the minibuffer if the function
|
||||||
is called with a prefix argument."
|
is called with a prefix argument."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (projectile-project-p)
|
|
||||||
(let* ((ignored (mapconcat (lambda (i)
|
(let* ((ignored (mapconcat (lambda (i)
|
||||||
(concat "--glob "
|
(concat "--glob "
|
||||||
(shell-quote-argument (concat "!" i))
|
(shell-quote-argument (concat "!" i))
|
||||||
|
|
@ -722,8 +717,7 @@ is called with a prefix argument."
|
||||||
(counsel-rg (eval counsel-projectile-rg-initial-input)
|
(counsel-rg (eval counsel-projectile-rg-initial-input)
|
||||||
(projectile-project-root)
|
(projectile-project-root)
|
||||||
options
|
options
|
||||||
(projectile-prepend-project-name "rg")))
|
(projectile-prepend-project-name "rg"))))
|
||||||
(user-error "You're not in a project")))
|
|
||||||
|
|
||||||
;;; counsel-projectile-org-capture
|
;;; counsel-projectile-org-capture
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue