]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix completion of variables in Eshell immediately after "$"
authorJim Porter <jporterbugs@gmail.com>
Sun, 6 Oct 2024 22:19:13 +0000 (15:19 -0700)
committerEshel Yaron <me@eshelyaron.com>
Mon, 7 Oct 2024 19:31:37 +0000 (21:31 +0200)
* lisp/eshell/esh-var.el (eshell-complete-variable-reference): Match
group 1 even when there's nothing after "$".

(cherry picked from commit 49325e13560daa768e6f455ade8c9284b7369a26)

lisp/eshell/esh-var.el

index 5d7ea1c36646d3291f50b3174c4bbaadbe216b6d..d53ae997cdf783a6ff724e5657fcbe4789010a1a 100644 (file)
@@ -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)))