emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/helm 228ba22048 2/2: Fix error in helm-grep--ag-command (#


From: ELPA Syncer
Subject: [nongnu] elpa/helm 228ba22048 2/2: Fix error in helm-grep--ag-command (#2682)
Date: Mon, 29 Jul 2024 16:00:03 -0400 (EDT)

branch: elpa/helm
commit 228ba22048e3a7d48d4bd62f415906a397be45d0
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Fix error in helm-grep--ag-command (#2682)
    
    when helm-grep-ag-command is not set (or available).
    Also add new grep action to helm-occur only when ag/rg is available.
---
 helm-grep.el  |  5 +++--
 helm-occur.el | 10 +++++++---
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/helm-grep.el b/helm-grep.el
index 0508a8690a..1c1f5380cc 100644
--- a/helm-grep.el
+++ b/helm-grep.el
@@ -1584,8 +1584,9 @@ non-file buffers."
 ;;  https://github.com/BurntSushi/ripgrep
 
 (defun helm-grep--ag-command ()
-  (car (helm-remove-if-match
-        "\\`[A-Z]*=" (split-string helm-grep-ag-command))))
+  (and helm-grep-ag-command
+       (car (helm-remove-if-match
+             "\\`[A-Z]*=" (split-string helm-grep-ag-command)))))
 
 (defun helm-grep-ag-get-types ()
   "Returns a list of AG types if available with AG version.
diff --git a/helm-occur.el b/helm-occur.el
index 9e0bac2e10..7767b62611 100644
--- a/helm-occur.el
+++ b/helm-occur.el
@@ -322,6 +322,7 @@ When GSHORTHANDS is nil use PATTERN unmodified."
 
 (defun helm-occur-build-sources (buffers &optional source-name)
   "Build sources for `helm-occur' for each buffer in BUFFERS list."
+  (require 'helm-grep)
   (setq helm-occur--gshorthands nil)
   (and helm-occur-match-shorthands
        (setq helm-occur--gshorthands
@@ -381,9 +382,12 @@ When GSHORTHANDS is nil use PATTERN unmodified."
                 :history 'helm-occur-history
                 :candidate-number-limit helm-occur-candidate-number-limit
                 :action (append helm-occur-actions
-                          `((,(format "%s grep buffer directory"
-                                      (upcase (helm-grep--ag-command)))
-                              . helm-occur-grep-ag-buffer-directory)))
+                                (helm-make-actions
+                                 (lambda ()
+                                   (when helm-grep-ag-command
+                                     (format "%s grep buffer directory"
+                                             (upcase 
(helm-grep--ag-command)))))
+                                 'helm-occur-grep-ag-buffer-directory))
                 :requires-pattern 2
                 :follow 1
                 :group 'helm-occur



reply via email to

[Prev in Thread] Current Thread [Next in Thread]