syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.71k stars 4.9k forks source link

Fix --batch never exiting after loading Spacemacs #16631

Closed bcc32 closed 2 weeks ago

bcc32 commented 3 weeks ago

Previously, attempting to use Spacemacs with --batch would hang forever. In that scenario, the function `command-line' attempts to kill batch-mode Emacs after processing command line arguments, but fails because Spacemacs advises kill-emacs.

Normally batch mode suppresses Spacemacs but it can be made to load Spacemacs like so:

emacs --batch -u $(whoami) --eval '(pp (+ 1 2))'

This should print 3 and exit, but without this commit it never exits.