diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2014-11-25 10:24:10 +0100 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2014-11-25 10:24:10 +0100 |
commit | 6922e225a0cd52a24a35a89b41376edcb5e08e52 (patch) | |
tree | cf1d902e9a1265612a4e4a579742114bfe9dfe39 /helm-grep.el | |
parent | d2488d2a9057968fcbe405da33e3da4a13cb9bba (diff) |
* helm-grep.el (helm-grep-use-ack-p): Fix ls-git,check if recursive command is set.
(helm-grep--prepare-cmd-line): no need to bind default-directory here.
(helm-grep-init): bind default-directory here.
(helm-do-grep-1): Remove unused var.
Diffstat (limited to 'helm-grep.el')
-rw-r--r-- | helm-grep.el | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/helm-grep.el b/helm-grep.el index b709db86..71c3f0a8 100644 --- a/helm-grep.el +++ b/helm-grep.el @@ -301,7 +301,7 @@ It is intended to use as a let-bound variable, DON'T set this globaly.") (let* ((rec-com (helm-grep-command t)) (norm-com (helm-grep-command)) (norm-com-ack-p (string-match "\\`ack" norm-com)) - (rec-com-ack-p (string-match "\\`ack" rec-com))) + (rec-com-ack-p (and rec-com (string-match "\\`ack" rec-com)))) (cl-case where (default (and norm-com norm-com-ack-p)) (recursive (and rec-com rec-com-ack-p)) @@ -311,9 +311,7 @@ It is intended to use as a let-bound variable, DON'T set this globaly.") (and rec-com rec-com-ack-p))))))) (defun helm-grep--prepare-cmd-line (only-files &optional include zgrep) - (let* ((default-directory (or helm-default-directory - (expand-file-name helm-ff-default-directory))) - (fnargs (helm-grep-prepare-candidates only-files)) + (let* ((fnargs (helm-grep-prepare-candidates only-files)) (ignored-files (unless (helm-grep-use-ack-p) (mapconcat #'(lambda (x) @@ -356,7 +354,9 @@ It is intended to use as a let-bound variable, DON'T set this globaly.") (defun helm-grep-init (cmd-line) "Start an asynchronous grep process with CMD-LINE using ZGREP if non--nil." - (let* ((zgrep (string-match "\\`zgrep" cmd-line)) + (let* ((default-directory (or helm-default-directory + (expand-file-name helm-ff-default-directory))) + (zgrep (string-match "\\`zgrep" cmd-line)) ;; Use pipe only with grep, zgrep or git-grep. (process-connection-type (and (not zgrep) (helm-grep-use-ack-p))) (tramp-verbose helm-tramp-verbose)) @@ -851,7 +851,6 @@ in recurse, search being made on `helm-zgrep-file-extension-regexp'." 'helm-grep-include-files (or include-files types) 'helm-grep-in-recurse recurse 'helm-grep-use-zgrep zgrep - 'helm-grep-last-default-directory helm-ff-default-directory 'helm-grep-default-command (cond (zgrep helm-default-zgrep-command) (recurse helm-grep-default-recurse-command) |