* 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
;; 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) ?\()