From f0e8728bbc18bad02c9e599eee8edf85c0076eb5 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 22 Jun 2022 01:05:38 +0200 Subject: [PATCH] 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 --- core/autoload/sessions.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/autoload/sessions.el b/core/autoload/sessions.el index 589622a95..54e6c01c5 100644 --- a/core/autoload/sessions.el +++ b/core/autoload/sessions.el @@ -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)