fix(lib): restart-emacs name collision on Emacs 29+

Emacs 29 introduces a new command: restart-emacs, which clashes with the
more featureful restart-emacs package that Doom installs to manage the
session. Fortunately, the built-in one is defines in files.el, which is
eagerly loaded at startup, so as long as the third-party one is
loaded (at some point), it shouldn't be a problem.

Fix: #6492
This commit is contained in:
Henrik Lissner 2022-06-22 01:05:38 +02:00
parent 170dadca5a
commit f0e8728bbc
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -113,7 +113,13 @@
(doom-save-session file))
;;;###autoload
(defalias 'doom/restart #'restart-emacs)
(defun doom/restart ()
"Restart Emacs (and the daemon, if active).
Unlike `doom/restart-and-restore', does not restart the current session."
(interactive)
(require 'restart-emacs)
(restart-emacs))
;;;###autoload
(defun doom/restart-and-restore (&optional debug)
@ -122,6 +128,7 @@
If DEBUG (the prefix arg) is given, start the new instance with the --debug
switch."
(interactive "P")
(require 'restart-emacs)
(doom/quicksave-session)
(save-some-buffers nil t)
(letf! ((#'save-buffers-kill-emacs #'kill-emacs)