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)