mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-27 14:23:43 -05:00
Even `emacs --batch -f kill-emacs` can take a non-trivial amount of time to start up (0.661s on my system). This makes the two `emacs` calls in bin/doom's shebang amount to >1s of startup time for Doom scripts (~1.5s on my system). This change removes the second call (or at least defers it until the after-script; at least, if $TMPDIR or $TEMP aren't set), bringing down that time to a more bearable 0.9s. This sacrifices the more descriptive "Can't find Emacs in your $PATH" error message should the user set their own $EMACS, but the alternative bash error is good enough: $ EMACS=foo doom version /home/$USER/.config/emacs/bin/doom: line 12: foo: command not found I'm not doing more sophisticated checks on $EMACS, because it could be a command (like `flatpak run org.gnu.emacs`), rather than an executable or path, and the boilerplate to handle that, within what small space we get in bin/doom's shebang, would be too much maintenance headache just for a slightly better error message.