From: Jim Porter Date: Sat, 11 Jan 2025 19:50:19 +0000 (-0800) Subject: Make Eshell's "ls" command return a non-zero status on errors X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2abbf3551d890968d1bc2a198ddfff46ffee76e5;p=emacs.git Make Eshell's "ls" command return a non-zero status on errors * lisp/eshell/em-ls.el (eshell/ls): Set exit code when calling 'error-func'. (cherry picked from commit aff9261ab2ab3cf3435cf006e600a575bc2e3d6b) --- diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index ce2e6ab7d60..52a330a3353 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el @@ -329,7 +329,7 @@ instead." "An alias version of `eshell-do-ls'." (eshell-with-buffered-print (let ((insert-func #'eshell-buffered-print) - (error-func #'eshell-error)) + (error-func (lambda (s) (eshell-error s) (eshell-set-exit-info 2)))) (apply 'eshell-do-ls args)))) (put 'eshell/ls 'eshell-no-numeric-conversions t)