diff options
author | Stefan Kangas <stefan@marxist.se> | 2022-03-02 06:33:19 +0100 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2022-03-02 06:33:19 +0100 |
commit | 6d78321ce824ede11ab04d976d46487bcd191cab (patch) | |
tree | e1f511f01c224bea7b70d1f4db52ccee5331b34a /lisp/eshell | |
parent | 2b130bd944a36510043750286106a16a1e2ad7c4 (diff) | |
parent | 9dadcbe4297fdd52e2664e99fe693ba35a51eb57 (diff) | |
download | emacs-6d78321ce824ede11ab04d976d46487bcd191cab.tar.gz |
Merge from origin/emacs-28
9dadcbe429 ; * doc/misc/eshell.texi (Dollars Expansion): Fix markup.
2c3d1b6bf4 Improve/correct documentation about Eshell variable expansion
9e257aecc9 Partially revert b03f74e0f2a578b1580e8b1c368665850ee7f808
Diffstat (limited to 'lisp/eshell')
-rw-r--r-- | lisp/eshell/esh-var.el | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 5c8dacd980e..ee3ffbc6475 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -34,7 +34,8 @@ ;; ;; "-" is a valid part of a variable name. ;; -;; $<MYVAR>-TOO +;; $\"MYVAR\"-TOO +;; $'MYVAR'-TOO ;; ;; Only "MYVAR" is part of the variable name in this case. ;; @@ -55,6 +56,11 @@ ;; Returns the value of an eshell subcommand. See the note above ;; regarding Lisp evaluations. ;; +;; $<command> +;; +;; Evaluates an eshell subcommand, redirecting the output to a +;; temporary file, and returning the file name. +;; ;; $ANYVAR[10] ;; ;; Return the 10th element of ANYVAR. If ANYVAR's value is a string, @@ -423,9 +429,12 @@ variable. Possible options are: NAME an environment or Lisp variable value - <LONG-NAME> disambiguates the length of the name + \"LONG-NAME\" disambiguates the length of the name + 'LONG-NAME' as above {COMMAND} result of command is variable's value - (LISP-FORM) result of Lisp form is variable's value" + (LISP-FORM) result of Lisp form is variable's value + <COMMAND> write the output of command to a temporary file; + result is the file name" (cond ((eq (char-after) ?{) (let ((end (eshell-find-delimiter ?\{ ?\}))) @@ -457,8 +466,12 @@ Possible options are: (eshell-as-subcommand ,(eshell-parse-command cmd)) (ignore (nconc eshell-this-command-hook - (list (lambda () - (delete-file ,temp))))) + ;; Quote this lambda; it will be evaluated + ;; by `eshell-do-eval', which requires very + ;; particular forms in order to work + ;; properly. See bug#54190. + (list (function (lambda () + (delete-file ,temp)))))) (quote ,temp))) (goto-char (1+ end))))))) ((eq (char-after) ?\() |