aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell
diff options
context:
space:
mode:
authorJim Porter2024-08-28 13:59:04 -0700
committerJim Porter2024-08-28 13:59:04 -0700
commite97ab1c41332e179939f457cc010a606a5124ff8 (patch)
treec5a7642ee068a238f2839e999e00228766068c60 /lisp/eshell
parent10802fb00f59594fa8e524e836eaf0e99e87dec9 (diff)
downloademacs-e97ab1c41332e179939f457cc010a606a5124ff8.tar.gz
emacs-e97ab1c41332e179939f457cc010a606a5124ff8.zip
Use 'eshell-with-handles' when executing an Eshell file
This makes sure we close the handles as we should, which is important for writing the output to an actual file (bug#72857). * lisp/eshell/em-script.el (esh-cmd): Require this, just to be explicit. (eshell-execute-file): Use 'eshell-with-handles'.
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/em-script.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el
index 80dea16106b..a8662c4a2b7 100644
--- a/lisp/eshell/em-script.el
+++ b/lisp/eshell/em-script.el
@@ -24,6 +24,7 @@
24;;; Code: 24;;; Code:
25 25
26(require 'esh-mode) 26(require 'esh-mode)
27(require 'esh-cmd)
27(require 'esh-io) 28(require 'esh-io)
28 29
29;;;###esh-module-autoload 30;;;###esh-module-autoload
@@ -127,10 +128,9 @@ Comments begin with `#'."
127 (with-temp-buffer 128 (with-temp-buffer
128 (eshell-mode) 129 (eshell-mode)
129 (eshell-do-eval 130 (eshell-do-eval
130 `(let ((eshell-current-handles 131 `(eshell-with-handles (,stdout 'insert ,stderr 'insert)
131 (eshell-create-handles ,stdout 'insert ,stderr 'insert)) 132 (let ((eshell-current-subjob-p))
132 (eshell-current-subjob-p)) 133 ,(eshell--source-file file args)))
133 ,(eshell--source-file file args))
134 t)))) 134 t))))
135 135
136(cl-defstruct (eshell-princ-target 136(cl-defstruct (eshell-princ-target