[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/shell-command+ c190d6c 02/13: Add shell-command+-flip-r
From: |
Stefan Monnier |
Subject: |
[elpa] externals/shell-command+ c190d6c 02/13: Add shell-command+-flip-redirection option |
Date: |
Sun, 23 May 2021 13:41:25 -0400 (EDT) |
branch: externals/shell-command+
commit c190d6c6be78d001d8aec4ec295c8c47b81a3fdc
Author: Philip K <philipk@posteo.net>
Commit: Philip K <philipk@posteo.net>
Add shell-command+-flip-redirection option
---
shell-command+.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/shell-command+.el b/shell-command+.el
index 2251720..1bf54b1 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -82,6 +82,10 @@ handlers if the symbol (eg. `man') is contained in the list."
"Prompt to use when invoking `shell-command+'."
:type 'string)
+(defcustom shell-command+-flip-redirection nil
+ "Flip the meaning of < and > at the beginning of a command."
+ :type 'boolean)
+
(defconst shell-command+--command-regexp
(rx bos
;; ignore all preceding whitespace
@@ -123,9 +127,11 @@ proper upwards directory pointers. This means that '....'
becomes
(error "Invalid command"))
(list (match-string-no-properties 1 command)
(cond ((string= (match-string-no-properties 2 command) "<")
- 'input)
+ (if shell-command+-flip-redirection
+ 'output 'input))
((string= (match-string-no-properties 2 command) ">")
- 'output)
+ (if shell-command+-flip-redirection
+ 'input 'output))
((string= (match-string-no-properties 2 command) "|")
'pipe))
(match-string-no-properties 4 command)
- [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, 2021/05/23
- [elpa] externals/shell-command+ c190d6c 02/13: Add shell-command+-flip-redirection option,
Stefan Monnier <=
- [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
- [elpa] externals/shell-command+ 9b1d98e 06/13: Fix shell-command+-cmd-grep invocation, Stefan Monnier, 2021/05/23