Skip to content

Commit

Permalink
fix: resolve conflict with built-in 'restart-emacs function in files
Browse files Browse the repository at this point in the history
- also removs unimplemented options --timed-requires and --adv-timers
  • Loading branch information
WarFox committed Apr 9, 2024
1 parent e83a5b3 commit d867958
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lisp/warmacs-restart.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@
;; Quit/Restart menu

(use-package restart-emacs
:commands (restart-emacs kill-emacs)
:commands (restart-emacs restart-emacs-start-new-emacs)
:preface
(defun warmacs/restart-emacs (&optional args)
(interactive)
(restart-emacs))
(restart-emacs args))

(defun warmacs/kill-emacs (prompt &optional args)
(interactive)
(if (not prompt)
(save-some-buffers nil t))
(kill-emacs args))
:after
(files)
:init
;; unbind 'restart-emacs to avoid conflict with built-in function in files.el
;; https://github.com/syl20bnr/spacemacs/pull/16186/files
(fmakunbound 'restart-emacs)
(autoload 'restart-emacs "restart-emacs" nil t)
:general
(warmacs/leader-menu "quit" "q"
"d" '("restart-emacs-debug-init" . (lambda (&optional args)
(interactive)
(warmacs/restart-emacs (cons "--debug-init" args))))
"R" #'warmacs/restart-emacs
"t" '("restart-emacs-timed-requires" . (lambda (&optional args)
(interactive)
(warmacs/restart-emacs (cons "--timed-requires" args))))
"T" '("restart-emacs-adv-timers" . (lambda (&optional args)
(interactive)
(warmacs/restart-emacs (cons "--adv-timers" args))))
"q" '("prompt-kill-emacs" . (lambda (&optional args)
(interactive)
(warmacs/kill-emacs t args)))))
Expand Down

0 comments on commit d867958

Please sign in to comment.