[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/shell-command+ c545590 1/2: Check if command is being p
From: |
ELPA Syncer |
Subject: |
[elpa] externals/shell-command+ c545590 1/2: Check if command is being piped |
Date: |
Wed, 6 Oct 2021 06:57:26 -0400 (EDT) |
branch: externals/shell-command+
commit c545590f4220056f3c79f7113865708bce8144cf
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Check if command is being piped
---
shell-command+.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/shell-command+.el b/shell-command+.el
index 53aa7dd..29d57ed 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -258,7 +258,7 @@ If EXPAND is non-nil, expand wildcards."
(group (+ (not space)))
;; Parse arguments
(*? space)
- (*? not-newline))
+ (group (*? not-newline)))
;; Ignore all trailing whitespace
(* space)
eos)
@@ -291,7 +291,13 @@ proper upwards directory pointers. This means that '....'
becomes
'input 'output))
((string= (match-string-no-properties 2 command) "|")
'pipe)
- ((string= (match-string-no-properties 2 command) "!")
+ ((or (string= (match-string-no-properties 2 command) "!")
+ ;; Check if the output of the command is being
+ ;; piped into some other command. In that case,
+ ;; interpret the command literally.
+ (let ((args (match-string-no-properties 5 command)))
+ (save-match-data
+ (member "|" (shell-command+-tokenize args)))))
'literal))
(match-string-no-properties 4 command)
(condition-case nil