[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/urgrep be61b9ddae 2/2: Fix Eshell wrapper for urgrep; r
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/urgrep be61b9ddae 2/2: Fix Eshell wrapper for urgrep; resolves #5 and #6 |
|
Date: |
Tue, 16 May 2023 23:00:19 -0400 (EDT) |
branch: externals/urgrep
commit be61b9ddae1ea69058650ccba5d0d690926efa96
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Jim Porter <jporterbugs@gmail.com>
Fix Eshell wrapper for urgrep; resolves #5 and #6
---
urgrep.el | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/urgrep.el b/urgrep.el
index c5dc5055d9..654dc8180d 100644
--- a/urgrep.el
+++ b/urgrep.el
@@ -1147,16 +1147,15 @@ to edit the command before running it."
(cl-eval-when (compile)
(require 'esh-cmd)
- (require 'esh-opt)
- (require 'em-unix))
+ (require 'esh-opt))
+
+;;;###autoload
+(eval-after-load 'esh-cmd '(add-to-list 'eshell-complex-commands "urgrep"))
;;;###autoload
(defun eshell/urgrep (&rest args)
"Recursively search for a pattern, passing ARGS.
This is meant to be used as a command in Eshell."
- (require 'esh-cmd)
- (require 'esh-opt)
- (require 'em-unix)
(eshell-eval-using-options
"urgrep" args
'(;; Regexp options
@@ -1211,15 +1210,16 @@ Recursively search for PATTERN within PATH.")
options)))
(when regexp (setq options (nconc `(:regexp ,(car regexp)) options)))
;; Run `urgrep'.
- (if (and (not eshell-plain-grep-behavior)
+ (if (and (not (bound-and-true-p eshell-plain-grep-behavior))
(eshell-interactive-output-p)
(not eshell-in-pipeline-p)
(not eshell-in-subcommand-p))
- (apply #'urgrep query directory options)
+ (apply #'urgrep query :directory directory options)
;; Return the arguments to run directly.
(when (not (equal directory default-directory))
(error "Can't use plain urgrep with a non-default directory yet"))
- (setq options (nconc '(:color nil) options))
+ (unless (eshell-interactive-output-p)
+ (setq options (append '(:color nil) options)))
(throw 'eshell-replace-command
(let* (;; Ensure we generate a POSIX shell-like command so that
;; Eshell can (hopefully) parse it correctly.