From fa051797f22527950263ef0e38f5b02b06ef7827 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 7 Oct 2019 12:56:53 -0400 Subject: [PATCH] Move --restore handler to autoload/sessions --- core/autoload/sessions.el | 6 ++++++ init.el | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/autoload/sessions.el b/core/autoload/sessions.el index 432d6a7b3..b0c6a6ec2 100644 --- a/core/autoload/sessions.el +++ b/core/autoload/sessions.el @@ -65,6 +65,12 @@ "TODO" (add-hook 'window-setup-hook #'doom-load-session 'append)) +;;;###autoload +(when (and command-line-args-left + (not noninteractive)) + (add-to-list 'command-switch-alist + (cons "--restore" #'doom-restore-session-handler))) + ;; ;;; Commands diff --git a/init.el b/init.el index 9f236f0c0..400e553b9 100644 --- a/init.el +++ b/init.el @@ -52,9 +52,6 @@ ;; And let 'er rip! (add-hook 'window-setup-hook #'doom-display-benchmark-h) -(when (cdr command-line-args) - (add-to-list 'command-switch-alist - (cons "--restore" #'doom-restore-session-handler))) (doom-initialize) (doom-initialize-core)