[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/urgrep b535f518eb: Add a shim for `split-string-shell-c
From: |
ELPA Syncer |
Subject: |
[elpa] externals/urgrep b535f518eb: Add a shim for `split-string-shell-command` |
Date: |
Mon, 7 Aug 2023 03:58:56 -0400 (EDT) |
branch: externals/urgrep
commit b535f518eb31e497f561bd447c812d7daef97b32
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Jim Porter <jporterbugs@gmail.com>
Add a shim for `split-string-shell-command`
---
urgrep.el | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/urgrep.el b/urgrep.el
index 579e8b19fc..c715c70bef 100644
--- a/urgrep.el
+++ b/urgrep.el
@@ -37,8 +37,9 @@
(require 'generator)
(require 'grep)
(require 'project)
+(require 'shell) ; For
`shell--parse-pcomplete-arguments'
(require 'text-property-search)
-(require 'xref) ; For `xref--regexp-to-extended'.
+(require 'xref) ; For `xref--regexp-to-extended'
(defgroup urgrep nil
"Run a grep-like command and display the results."
@@ -119,6 +120,16 @@ The currently-used tool can be inspected from the hook via
;; Urgrep utility functions
+;; `format-prompt' was added in Emacs 28.1.
+(defalias 'urgrep--split-string-shell-command
+ (if (fboundp 'split-string-shell-command)
+ #'split-string-shell-command
+ (lambda (string)
+ (with-temp-buffer
+ (insert string)
+ (let ((comint-file-name-quote-list shell-file-name-quote-list))
+ (car (shell--parse-pcomplete-arguments)))))))
+
(defun urgrep--convert-regexp (expr from-syntax to-syntax)
"Convert the regexp EXPR from FROM-SYNTAX to TO-SYNTAX."
(cond ((and (not (eq from-syntax to-syntax))
@@ -518,7 +529,7 @@ in `urgrep-tools'. Otherwise, return TOOL as-is."
(defun urgrep--guess-tool (command)
"Guess the urgrep tool from the specified COMMAND."
(catch 'found
- (when-let ((args (split-string-shell-command
+ (when-let ((args (urgrep--split-string-shell-command
;; First, split by semicolon, since
;; `split-string-shell-command' only returns the *last*
;; command.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/urgrep b535f518eb: Add a shim for `split-string-shell-command`,
ELPA Syncer <=