]> git.eshelyaron.com Git - emacs.git/commitdiff
Kill the buffer for the temp file after using '$<command>' in Eshell
authorJim Porter <jporterbugs@gmail.com>
Sat, 20 Aug 2022 17:48:32 +0000 (10:48 -0700)
committerJim Porter <jporterbugs@gmail.com>
Fri, 26 Aug 2022 05:08:38 +0000 (22:08 -0700)
* 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

lisp/eshell/esh-var.el

index 2f6614b5d73088affde638ca3bce2e522f23e253..a9df172e88e7ce70dca003e6db6e7d9edd3f7561 100644 (file)
@@ -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) ?\()