emacs-devel
[Top][All Lists]
Advanced

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

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


From: Eli Zaretskii
Subject: Re: Help using the right hook for loading theme on emacs daemon GUI
Date: Thu, 17 Jan 2019 23:50:16 +0200

> From: Kaushal Modi <address@hidden>
> Date: Thu, 17 Jan 2019 10:44:05 -0500
> 
> 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?

Emacs 27 has server-after-make-frame-function which you could use.



reply via email to

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