From 6c677a101d16cffd1e59acf090c4769561f82a53 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 12 Oct 2019 23:15:43 +0200 Subject: [PATCH] Mention the Emacs exit code in batch mode * doc/lispref/os.texi (Batch Mode): Mention what the exit code is if an error is signalled (bug#31552). --- doc/lispref/os.texi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 912d464b49b..93551cab0e5 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -2595,6 +2595,15 @@ if it is non-@code{nil}; this can be overridden by binding This variable is non-@code{nil} when Emacs is running in batch mode. @end defvar +If Emacs exits due to signalling an error in batch mode, the exit +status of the Emacs command is non-zero: + +@example +$ emacs -Q --batch --eval '(error "foo")'; echo $? +foo +255 +@end example + @node Session Management @section Session Management @cindex session manager -- 2.39.5