[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/shell-command+ 7d39cf5 01/13: Simplify shell-command+--
From: |
Stefan Monnier |
Subject: |
[elpa] externals/shell-command+ 7d39cf5 01/13: Simplify shell-command+--command-regexp |
Date: |
Sun, 23 May 2021 13:41:25 -0400 (EDT) |
branch: externals/shell-command+
commit 7d39cf571a78aaae0f97350f3cb3c471c3ac2e3c
Author: Philip K <philipk@posteo.net>
Commit: Philip K <philipk@posteo.net>
Simplify shell-command+--command-regexp
---
shell-command+.el | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/shell-command+.el b/shell-command+.el
index 7d309d3..2251720 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -91,7 +91,7 @@ handlers if the symbol (eg. `man') is contained in the list."
(* (not space)))
(+ space))
;; check for redirection indicator
- (? (or (group ?<) (group ?>) (group ?|) ?!))
+ (? (group (or ?< ?> ?| ?!)))
;; allow whitespace after indicator
(* space)
;; actual command (and command name)
@@ -122,22 +122,20 @@ proper upwards directory pointers. This means that
'....' becomes
(unless (string-match shell-command+--command-regexp command)
(error "Invalid command"))
(list (match-string-no-properties 1 command)
- (cond ((match-string-no-properties 2 command) ;<
+ (cond ((string= (match-string-no-properties 2 command) "<")
'input)
- ((match-string-no-properties 3 command) ;>
+ ((string= (match-string-no-properties 2 command) ">")
'output)
- ((match-string-no-properties 4 command) ;|
+ ((string= (match-string-no-properties 2 command) "|")
'pipe))
- (match-string-no-properties 6 command)
+ (match-string-no-properties 4 command)
(condition-case nil
(replace-regexp-in-string
(rx (* ?\\ ?\\) (or ?\\ (group "%")))
buffer-file-name
- (match-string-no-properties 5 command)
+ (match-string-no-properties 3 command)
nil nil 1)
- (error (match-string-no-properties 5 command))))))
-
-(shell-command+-parse "ls %")
+ (error (match-string-no-properties 3 command))))))
;;;###autoload
(defun shell-command+ (command beg end)
- [elpa] externals/shell-command+ updated (7d818ba -> f65aca2), Stefan Monnier, 2021/05/23
- [elpa] externals/shell-command+ 7d39cf5 01/13: Simplify shell-command+--command-regexp,
Stefan Monnier <=
- [elpa] externals/shell-command+ c190d6c 02/13: Add shell-command+-flip-redirection option, Stefan Monnier, 2021/05/23
- [elpa] externals/shell-command+ 1b29abe 03/13: Remove hard dependency on eshell, Stefan Monnier, 2021/05/23
- [elpa] externals/shell-command+ ca82436 12/13: Update documentation to reflect eshell deprecation, Stefan Monnier, 2021/05/23
- [elpa] externals/shell-command+ a891756 04/13: Detect errors during tokenization, Stefan Monnier, 2021/05/23
- [elpa] externals/shell-command+ f65aca2 13/13: Bump version to 2.2.0, Stefan Monnier, 2021/05/23
- [elpa] externals/shell-command+ d0004fa 05/13: Add EXPAND parameter to shell-command+-tokenize, Stefan Monnier, 2021/05/23
- [elpa] externals/shell-command+ 13980c6 11/13: Fix copyright header in shell-command+-tests.el, Stefan Monnier, 2021/05/23
- [elpa] externals/shell-command+ e76acf5 10/13: Remove test code from main file, Stefan Monnier, 2021/05/23
- [elpa] externals/shell-command+ 9aaa4cb 07/13: Accept only one argument in locate, Stefan Monnier, 2021/05/23
- [elpa] externals/shell-command+ 86caf3d 09/13: Add tests for shell-command+-tokenize, Stefan Monnier, 2021/05/23