summaryrefslogtreecommitdiff
path: root/lisp/eshell
diff options
context:
space:
mode:
authorJim Porter <jporterbugs@gmail.com>2022-04-26 21:51:23 -0700
committerLars Ingebrigtsen <larsi@gnus.org>2022-05-01 20:41:21 +0200
commitbb40507fed7b211bb0ef5b5e3dcc609876f6ad8d (patch)
tree1ea82c099719bf3caf267ea257027bb90bb22905 /lisp/eshell
parentade1424a975aabaa208010c6fdd3c8b7c51242ff (diff)
downloademacs-bb40507fed7b211bb0ef5b5e3dcc609876f6ad8d.tar.gz
emacs-bb40507fed7b211bb0ef5b5e3dcc609876f6ad8d.tar.bz2
emacs-bb40507fed7b211bb0ef5b5e3dcc609876f6ad8d.zip
Handle escaped characters in Eshell argument predicates/modifiers
* lisp/eshell/em-pred.el (eshell-get-delimited-modifier-argument): Unescape escaped characters. * test/lisp/eshell/em-pred-tests.el (em-pred-test/predicate-escaping): New test (bug#55204).
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/em-pred.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el
index 594563554d2..d73976d3464 100644
--- a/lisp/eshell/em-pred.el
+++ b/lisp/eshell/em-pred.el
@@ -416,7 +416,9 @@ before the closing delimiter. This allows modifiers like
(close (cdr (assoc open eshell-pred-delimiter-pairs)))
(end (eshell-find-delimiter open close nil nil t)))
(prog1
- (buffer-substring-no-properties (1+ (point)) end)
+ (replace-regexp-in-string
+ (rx-to-string `(seq "\\" (group (or "\\" ,open ,close)))) "\\1"
+ (buffer-substring-no-properties (1+ (point)) end))
(goto-char (if (and chained-p (eq open close))
end
(1+ end))))))