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: martin rudalics
Subject: Re: Help using the right hook for loading theme on emacs daemon GUI
Date: Thu, 17 Jan 2019 19:33:14 +0100

> 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?

Window change functions are neither related to 'window-setup-hook' nor
to 'after-make-frame-functions'.  Historically, window change
functions can be run for a frame only "after that frame has been made"
and nothing has changed in this regard (hopefully).

I suppose that what you see is Bug#34114.

martin



reply via email to

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