fix(lib): type error on doom/restart-and-restore
On Windows, restart-emacs doesn't escape its arguments properly (#6219).56686f677a
attempted to fix this, but ended up breaking it for everyone else as well, causing the type error: Wrong type argument: listp, "--eval \"(add-hook 'window-setup-hook #'doom-load-session 100)\"" This commit fixes both the regression and the original issue. Amend:56686f677a
Fix: #6219
This commit is contained in:
parent
80cd7557e1
commit
0e2fa0ba19
1 changed files with 15 additions and 7 deletions
|
@ -122,14 +122,22 @@
|
||||||
If DEBUG (the prefix arg) is given, start the new instance with the --debug
|
If DEBUG (the prefix arg) is given, start the new instance with the --debug
|
||||||
switch."
|
switch."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(setq doom-autosave-session nil)
|
|
||||||
(doom/quicksave-session)
|
(doom/quicksave-session)
|
||||||
(save-some-buffers nil t)
|
(save-some-buffers nil t)
|
||||||
(letf! ((#'save-buffers-kill-emacs #'kill-emacs)
|
(letf! ((#'save-buffers-kill-emacs #'kill-emacs)
|
||||||
(confirm-kill-emacs))
|
(confirm-kill-emacs)
|
||||||
|
(tmpfile (make-temp-file "post-load")))
|
||||||
|
;; HACK `restart-emacs' does not properly escape arguments on Windows (in
|
||||||
|
;; `restart-emacs--daemon-on-windows' and
|
||||||
|
;; `restart-emacs--start-gui-on-windows'), so don't give it complex
|
||||||
|
;; arguments at all. Should be fixed upstream, but restart-emacs seems to
|
||||||
|
;; be unmaintained.
|
||||||
|
(with-temp-file tmpfile
|
||||||
|
(print `(progn (add-hook 'window-setup-hook #'doom-load-session 100)
|
||||||
|
(delete-file ,tmpfile))
|
||||||
|
(current-buffer)))
|
||||||
(restart-emacs
|
(restart-emacs
|
||||||
(combine-and-quote-strings
|
(append (if debug (list "--debug-init"))
|
||||||
(append (if debug (list "--debug-init"))
|
(when (boundp 'chemacs-current-emacs-profile)
|
||||||
(when (boundp 'chemacs-current-emacs-profile)
|
(list "--with-profile" chemacs-current-emacs-profile))
|
||||||
(list "--with-profile" chemacs-current-emacs-profile))
|
(list "-l" tmpfile)))))
|
||||||
(list "--eval" "(add-hook 'window-setup-hook #'doom-load-session 100)"))))))
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue