emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help using the right hook for loading theme on emacs daemon GUI


From: Kaushal Modi
Subject: Help using the right hook for loading theme on emacs daemon GUI
Date: Thu, 17 Jan 2019 10:44:05 -0500

Hello,

I noticed that the windows hooks have been revamped recently in https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=0aece3e1181e66f2a1a067ae876e55bdaa45edd5.

But that breaks the theme loading in my config, and I'd like to know the correct way to do the same after this change.

At present, I have this in my config:

=====

;; Load the theme ONLY after the frame has finished loading (needed especially
;; when running emacs in daemon mode)
;; https://github.com/Malabarba/smart-mode-line/issues/84#issuecomment-46429893
;; ;; `after-make-frame-functions' hook is not run in no-window mode
;; (add-hook 'after-make-frame-functions (lambda (&rest frame)
;;                                         (funcall default-theme-fn)))
(add-hook 'window-setup-hook (lambda () (funcall default-theme-fn)))
=====

The `default-theme-fn' is just a wrapper function that `load-theme's my theme.

Earlier, on launching emacsclient, that function would get called after the frame loading finished.

But with the recent change, that function probably gets called before the frame loading has finished, and so the function is ineffective.

If I manually load my theme after the frame launches, I get my old theme back.

So, what should I replace `window-setup-hook' with that runs in both -nw mode and GUI mode emacsclient?

Thanks!


--
Kaushal Modi

reply via email to

[Prev in Thread] Current Thread [Next in Thread]