summaryrefslogtreecommitdiff
path: root/lisp/eshell/esh-var.el
diff options
context:
space:
mode:
authorJim Porter <jporterbugs@gmail.com>2022-08-20 10:48:32 -0700
committerJim Porter <jporterbugs@gmail.com>2022-08-25 22:08:38 -0700
commita457aa62577284333c7d25d48a49704788b25a04 (patch)
tree07b6fbe031b115482cc188bbfa32917654411ad5 /lisp/eshell/esh-var.el
parent23c01a23a3a23ad195ebbbaad9a0b6de846b41b0 (diff)
downloademacs-a457aa62577284333c7d25d48a49704788b25a04.tar.gz
Kill the buffer for the temp file after using '$<command>' in Eshell
* lisp/eshell/esh-var.el (eshell-parse-variable-ref): Kill the temp file's buffer when we're done. Ref: https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-08/msg01444.html
Diffstat (limited to 'lisp/eshell/esh-var.el')
-rw-r--r--lisp/eshell/esh-var.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index 2f6614b5d73..a9df172e88e 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -490,8 +490,11 @@ Possible variable references are:
;; by `eshell-do-eval', which requires very
;; particular forms in order to work
;; properly. See bug#54190.
- (list (function (lambda ()
- (delete-file ,temp))))))
+ (list (function
+ (lambda ()
+ (delete-file ,temp)
+ (when-let ((buffer (get-file-buffer ,temp)))
+ (kill-buffer buffer)))))))
(eshell-apply-indices ,temp indices ,eshell-current-quoted)))
(goto-char (1+ end)))))))
((eq (char-after) ?\()