From: Jim Porter Date: Sun, 6 Oct 2024 22:19:13 +0000 (-0700) Subject: ; Fix completion of variables in Eshell immediately after "$" X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=20abd7ab67835cfbf610a8045001a3ed63903787;p=emacs.git ; Fix completion of variables in Eshell immediately after "$" * lisp/eshell/esh-var.el (eshell-complete-variable-reference): Match group 1 even when there's nothing after "$". (cherry picked from commit 49325e13560daa768e6f455ade8c9284b7369a26) --- diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 5d7ea1c3664..d53ae997cdf 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -840,10 +840,10 @@ START and END." (let ((arg (pcomplete-actual-arg))) (when (string-match (rx "$" (? (or "#" "@")) - (? (or (group-n 1 (regexp eshell-variable-name-regexp) - string-end) - (seq (group-n 2 (or "'" "\"")) - (group-n 1 (+ anychar)))))) + (or (group-n 1 (? (regexp eshell-variable-name-regexp)) + string-end) + (seq (group-n 2 (or "'" "\"")) + (group-n 1 (+ anychar))))) arg) (setq pcomplete-stub (substring arg (match-beginning 1))) (let ((delimiter (match-string 2 arg)))