Refactor 'eat--eshell-adjust-make-process-args'

* eat.el (eat--eshell-adjust-make-process-args): Move the
'add-hook' out of 'unwind-protect'.
This commit is contained in:
Akib Azmain Turja 2022-12-15 13:00:06 +06:00
parent 162ec61f3d
commit 559c9c362c
No known key found for this signature in database
GPG key ID: 5535FCF54D88616B

13
eat.el
View file

@ -5543,9 +5543,8 @@ Disable terminal emulation?")))
(set-process-filter proc #'eat--eshell-filter)
(set-process-sentinel proc #'eat--eshell-sentinel)
(eat--eshell-setup-proc-and-term proc))))
(unwind-protect
(progn
(add-hook 'eshell-exec-hook hook 99)
(unwind-protect
(cond
;; Emacs 29 and above.
((>= emacs-major-version 29)
@ -5562,8 +5561,8 @@ Disable terminal emulation?")))
(apply make-process plist)
(setf (plist-get plist :command)
`("/usr/bin/env" "sh" "-c"
,(format "stty -nl echo rows %d \
columns %d sane 2>%s ; if [ $1 = .. ]; then shift; fi; exec \"$@\""
,(format "stty -nl echo rows %d columns\
%d sane 2>%s ; if [ $1 = .. ]; then shift; fi; exec \"$@\""
(floor (window-screen-lines))
(window-max-chars-per-line)
null-device)
@ -5579,13 +5578,13 @@ columns %d sane 2>%s ; if [ $1 = .. ]; then shift; fi; exec \"$@\""
(lambda (name buffer &rest command)
(apply start-file-process name buffer
"/usr/bin/env" "sh" "-c"
(format "stty -nl echo rows %d columns \
%d sane 2>%s ; if [ $1 = .. ]; then shift; fi; exec \"$@\""
(format "stty -nl echo rows %d columns %d \
sane 2>%s ; if [ $1 = .. ]; then shift; fi; exec \"$@\""
(floor (window-screen-lines))
(window-max-chars-per-line)
null-device)
".." command))))
(funcall fn command args)))))
(funcall fn command args))))
(remove-hook 'eshell-exec-hook hook)))))