emacs: defer daemon startup initialization
This commit is contained in:
@@ -1389,8 +1389,10 @@ The file server file for this emacs instance no longer exists.")
|
|||||||
(defun imalison:get-this-server-filepath ()
|
(defun imalison:get-this-server-filepath ()
|
||||||
(let ((server-dir (if server-use-tcp server-auth-dir server-socket-dir)))
|
(let ((server-dir (if server-use-tcp server-auth-dir server-socket-dir)))
|
||||||
(expand-file-name server-name server-dir)))
|
(expand-file-name server-name server-dir)))
|
||||||
(when (equal nil (server-running-p)) (server-start)
|
(unless (daemonp)
|
||||||
(imalison:make-main-emacs-server))))
|
(when (equal nil (server-running-p))
|
||||||
|
(server-start)
|
||||||
|
(imalison:make-main-emacs-server)))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** list-environment
|
** list-environment
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
@@ -4110,6 +4112,9 @@ Ensure all themes that I use are installed:
|
|||||||
:commands doom-modeline-mode
|
:commands doom-modeline-mode
|
||||||
:custom
|
:custom
|
||||||
(doom-modeline-height 40))
|
(doom-modeline-height 40))
|
||||||
|
|
||||||
|
(defvar imalison:enable-doom-modeline-on-startup nil
|
||||||
|
"Non-nil means enable `doom-modeline-mode' during startup.")
|
||||||
#+end_src
|
#+end_src
|
||||||
** page-break-lines
|
** page-break-lines
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
@@ -4260,11 +4265,24 @@ load-theme hook (See the heading below).
|
|||||||
(load-theme imalison:dark-theme t))
|
(load-theme imalison:dark-theme t))
|
||||||
(apply 'imalison:appearance args)
|
(apply 'imalison:appearance args)
|
||||||
(message "running appearance")
|
(message "running appearance")
|
||||||
(doom-modeline-mode +1)
|
(when (and imalison:enable-doom-modeline-on-startup
|
||||||
|
(fboundp 'doom-modeline-mode))
|
||||||
|
(doom-modeline-mode +1))
|
||||||
(setq imalison:default-font-size-pt (face-attribute 'default :height))
|
(setq imalison:default-font-size-pt (face-attribute 'default :height))
|
||||||
(setq imalison:appearance-setup-done t)))
|
(setq imalison:appearance-setup-done t)))
|
||||||
|
|
||||||
(add-hook 'elpaca-after-init-hook 'imalison:appearance-setup-hook)
|
(defun imalison:daemon-startup-p ()
|
||||||
|
(or (daemonp)
|
||||||
|
(seq-some (lambda (arg)
|
||||||
|
(or (string= arg "--daemon")
|
||||||
|
(string= arg "--bg-daemon")
|
||||||
|
(string-prefix-p "--daemon=" arg)
|
||||||
|
(string-prefix-p "--bg-daemon=" arg)))
|
||||||
|
command-line-args)))
|
||||||
|
|
||||||
|
(if (imalison:daemon-startup-p)
|
||||||
|
(add-hook 'server-after-make-frame-hook 'imalison:appearance-setup-hook)
|
||||||
|
(add-hook 'elpaca-after-init-hook 'imalison:appearance-setup-hook))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
* Post Init Custom
|
* Post Init Custom
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|||||||
@@ -186,5 +186,9 @@
|
|||||||
(let ((load-source-file-function nil)) (load autoloads))))
|
(let ((load-source-file-function nil)) (load autoloads))))
|
||||||
(require 'elpaca)
|
(require 'elpaca)
|
||||||
(setq elpaca-log-functions '(elpaca-log-command-query))
|
(setq elpaca-log-functions '(elpaca-log-command-query))
|
||||||
(add-hook 'after-init-hook #'elpaca-process-queues)
|
(if (daemonp)
|
||||||
|
(add-hook 'after-init-hook
|
||||||
|
(lambda ()
|
||||||
|
(run-with-idle-timer 1 nil #'elpaca-process-queues)))
|
||||||
|
(add-hook 'after-init-hook #'elpaca-process-queues))
|
||||||
(elpaca `(,@elpaca-order))
|
(elpaca `(,@elpaca-order))
|
||||||
|
|||||||
Reference in New Issue
Block a user