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

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

[elpa] externals/shell-command+ 7942428 1/2: Insert expected flags into


From: ELPA Syncer
Subject: [elpa] externals/shell-command+ 7942428 1/2: Insert expected flags into grep command
Date: Wed, 30 Jun 2021 18:57:21 -0400 (EDT)

branch: externals/shell-command+
commit 794242809672be8e78182e1d4164abc114f158c8
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Insert expected flags into grep command
---
 shell-command+.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/shell-command+.el b/shell-command+.el
index aaad41d..79fff81 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -156,7 +156,13 @@ If EXPAND is non-nil, expand wildcards."
 
 (defun shell-command+-cmd-grep (command)
   "Convert COMMAND into a `grep' call."
-  (grep (mapconcat #'identity (shell-command+-tokenize command t) " ")))
+  (grep-compute-defaults)
+  (pcase-let ((`(,cmd . ,args) (shell-command+-tokenize command t)))
+    (grep (mapconcat #'identity
+                     (cons (replace-regexp-in-string
+                            (concat "\\`" grep-program) cmd grep-command)
+                           args)
+                     " "))))
 
 (defun shell-command+-cmd-find (command)
   "Convert COMMAND into a `find-dired' call."



reply via email to

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