]> git.eshelyaron.com Git - emacs.git/commitdiff
Make Eshell's "ls" command return a non-zero status on errors
authorJim Porter <jporterbugs@gmail.com>
Sat, 11 Jan 2025 19:50:19 +0000 (11:50 -0800)
committerEshel Yaron <me@eshelyaron.com>
Sun, 12 Jan 2025 14:58:41 +0000 (15:58 +0100)
* lisp/eshell/em-ls.el (eshell/ls): Set exit code when calling 'error-func'.

(cherry picked from commit aff9261ab2ab3cf3435cf006e600a575bc2e3d6b)

lisp/eshell/em-ls.el

index ce2e6ab7d60f4445c12bbb3d701302bcefd537e5..52a330a33532583e66bcf6f4516a0e53b17eb5cc 100644 (file)
@@ -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)