summaryrefslogtreecommitdiff
path: root/helm-grep.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2016-10-25 07:38:51 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2016-10-25 07:38:51 +0200
commit9b994ae0f523114735f8c07b955ceaddd3f84a80 (patch)
tree8e404824b0c6c7a2a616bd0aa05813f8c86d47ca /helm-grep.el
parentf4b1cfdd932109485fbd6e5c6f5c2f27c87ac94a (diff)
Fix grep sentinel for zgrep.
* helm-grep.el (helm-grep-init): Workaround zgrep bug that exit with code 1 after a certain amount of result.
Diffstat (limited to 'helm-grep.el')
-rw-r--r--helm-grep.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/helm-grep.el b/helm-grep.el
index 6a563a32..77326fd3 100644
--- a/helm-grep.el
+++ b/helm-grep.el
@@ -503,10 +503,10 @@ It is intended to use as a let-bound variable, DON'T set this globaly.")
(helm-process-deferred-sentinel-hook
process event (helm-default-directory)))
(cond ((and noresult
- ;; [FIXME] This is a workaround for zgrep
+ ;; This is a workaround for zgrep
;; that exit with code 1
;; after a certain amount of results.
- (not (with-helm-buffer helm-grep-use-zgrep)))
+ (with-helm-buffer (helm-empty-buffer-p)))
(with-helm-buffer
(insert (concat "* Exit with code 1, no result found,"
" command line was:\n\n "
@@ -525,7 +525,12 @@ It is intended to use as a let-bound variable, DON'T set this globaly.")
(helm-grep-command t)
(helm-grep-command)))))
'face 'helm-grep-finish))))))
- ((string= event "finished\n")
+ ((or (string= event "finished\n")
+ (and noresult
+ ;; This is a workaround for zgrep
+ ;; that exit with code 1
+ ;; after a certain amount of results.
+ (with-helm-buffer (not (helm-empty-buffer-p)))))
(with-helm-window
(setq mode-line-format
'(" " mode-line-buffer-identification " "