fix: improve startup error message

Showing `user-init-file` in the startup message seems more confusing
than helpful, especially to beginners, as it's not a file they can (or
should) be editing to fix whatever caused the error. Plus, its value
could be `t` if the error happens late enough in the startup process,
which is even less helpful.
This commit is contained in:
Henrik Lissner 2024-07-30 17:37:59 -04:00
parent 8be1ef498b
commit 07f88f94ea
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -407,11 +407,10 @@ If RETURN-P, return the message as a string instead of displaying it."
(display-warning
'initialization
(format-message "\
An error occurred while loading `%s':\n\n%s%s%s\n\n\
An error occurred while booting Doom Emacs:\n\n%s%s%s\n\n\
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
cause of the error in your Doom config files. Start Emacs with
the `--debug-init' option to view a complete error backtrace."
user-init-file
(get (car error) 'error-message)
(if (cdr error) ": " "")
(mapconcat (lambda (s) (prin1-to-string s t))