]> git.eshelyaron.com Git - emacs.git/commit
Rework how 'eshell-ensure-newline-p' adds newlines
authorJim Porter <jporterbugs@gmail.com>
Thu, 23 May 2024 21:55:59 +0000 (14:55 -0700)
committerEshel Yaron <me@eshelyaron.com>
Thu, 30 May 2024 14:27:12 +0000 (16:27 +0200)
commitbd9f5472b98183e69ef82ca3f9b7d6d779246eb5
treeb0fc4d06e7da35bdb2767e348573f78696315d1e
parent8dc5f8a6843b00ea7aba4b3d0c5d72322966e85e
Rework how 'eshell-ensure-newline-p' adds newlines

This allows for other output targets (see the following commit) to be
"line-oriented".

* lisp/eshell/esh-io.el (eshell-ensure-newline-p): Move from esh-cmd.el.
(eshell-target-line-oriented-p, eshell--output-maybe-n)
(eshell-print-maybe-n, eshell-error-maybe-n)
(eshell-maybe-output-newline): New functions.

* lisp/eshell/esh-cmd.el (eshell-lisp-command): Don't print a newline
in this function directly; instead, use 'eshell-print-maybe-n' and
'eshell-error-maybe-n'.
(eshell-ensure-newline-p): Move to esh-io.el.

* lisp/eshell/em-unix.el (eshell/cat): Remove now-unnecessary override
of 'eshell-ensure-newline-p'.

(cherry picked from commit eac608cb8041222ba3b2eac48ac6f76ac36bab16)
lisp/eshell/em-unix.el
lisp/eshell/esh-cmd.el
lisp/eshell/esh-io.el