From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.devel Subject: Help using the right hook for loading theme on emacs daemon GUI Date: Thu, 17 Jan 2019 10:44:05 -0500 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e530cb057fa945ef" X-Trace: blaine.gmane.org 1547740416 25105 195.159.176.226 (17 Jan 2019 15:53:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 17 Jan 2019 15:53:36 +0000 (UTC) To: Emacs developers , martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 17 16:53:31 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gk9z1-0006OA-8T for ged-emacs-devel@m.gmane.org; Thu, 17 Jan 2019 16:53:31 +0100 Original-Received: from localhost ([127.0.0.1]:47037 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkA18-0001oS-9w for ged-emacs-devel@m.gmane.org; Thu, 17 Jan 2019 10:55:42 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gk9qX-00025s-Oh for emacs-devel@gnu.org; Thu, 17 Jan 2019 10:44:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gk9qW-0005DT-Rg for emacs-devel@gnu.org; Thu, 17 Jan 2019 10:44:45 -0500 Original-Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]:42540) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gk9qW-0005BO-Jh for emacs-devel@gnu.org; Thu, 17 Jan 2019 10:44:44 -0500 Original-Received: by mail-lf1-x12c.google.com with SMTP id l10so8131310lfh.9 for ; Thu, 17 Jan 2019 07:44:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Vs7fAr1hOFyF+Reh6cIzoibIo4mZiuQr+h0o+4En9UY=; b=ZEBeJeezgCKlp0hPXaGcCNsmVYNya/d2/maepEw//rYLs9j9ixArTTtIh/EJ/AGn+L GOoU9IF4Gkq1PoPi+hXXjMi8wfcTUrNl3LkfkfEnoPCtQFVTtMleDH2CkcGtc7jqZlFL fQw9rEs5cVzXhdUvTkFIDeyZHQHSi47gX/Y99gnH66Rk8bGRwzS1+e3KmxLjdRU72kXG FetR8iY96Uv0aRCPEVTx0X4cgeVMYDUuz6QvgWAwEuKxzh+Z7vxY5OhBlwxroInvx7KE ln5brgopVLtj8bViZxIhJKosXOHcSQ2ulvVlSERS4merv0e7u4Bh8o1VsFqhNup+VDSf z4JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Vs7fAr1hOFyF+Reh6cIzoibIo4mZiuQr+h0o+4En9UY=; b=WLeFu3KCohga6FjNFvVvto5Fvc3pcZwA6lniO42v5u77khbxSPTueRQ2h1aaX9YvMM HxgH6Nh2ou1Q0BBOs9gw3TNgsgRj7hX+bS6jBEOU2MlzJJRx/2zIIDc8xwe0C12PzjVh X+dT5G1doomP9Vkz0UKsGT9Fi21VnpZa57+gK2drJ9XOIv0XFovxVktD3mdxesxkHDWJ zwDU29JJTtfkkpnM2L/5l5iORVYb1BIVnbtEAMMGVqOO5Gj6vO51bsoxrg79Kv+HJOvl 3VNEKG5IoYx0KHLSB/DypnQdY/vAayYYLK6atV7jaGpVJ+Q02Av1c79t/j26T+OggYHH +s1Q== X-Gm-Message-State: AJcUukeLMh91dDTjc+WLmDGrc4VHY1uM3nMoDNAwmpfScSeAhOsknqJc Asr6GbVkDg6cXaav4nHH+Hgw20cS9jCZmdqvfrRKhMHl X-Google-Smtp-Source: ALg8bN5uA99tMw+tZXRzgaMtHq0su9dhSk7HxrX0/UrhCV7tFCWMgOEQe3sGlXLCVyVwwRK76PqKFHZmeNK3NnC24rk= X-Received: by 2002:a19:a86:: with SMTP id 128mr10169225lfk.139.1547739882400; Thu, 17 Jan 2019 07:44:42 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::12c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232429 Archived-At: --000000000000e530cb057fa945ef Content-Type: text/plain; charset="UTF-8" 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 --000000000000e530cb057fa945ef Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,
I noticed that the windows hooks have been revamped recently i= n https://git.savannah.gnu.org/cgit/emac= s.git/commit/?id=3D0aece3e1181e66f2a1a067ae876e55bdaa45edd5.
=
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:

=3D=3D=3D=3D=3D

;; Load the theme ONLY after the frame has f= inished 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 i= s not run in no-window mode
;; (add-hook 'after-make-frame-functions= (lambda (&rest frame)
;;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (funcall default-theme-fn)= ))
(add-hook 'window-setup-hook (lambda () (funcall default-theme-fn= )))
=3D=3D=3D=3D=3D

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

<= /div>
Earlier, on launching emacsclient, that function would get called= after the frame loading finished.

But with the re= cent change, that function probably gets called before the frame loading ha= s 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?

<= /div>
Thanks!


--
Kaushal Modi
--000000000000e530cb057fa945ef--