From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.help Subject: Getting `load-theme` to work in `-batch` mode? Date: Tue, 13 Feb 2024 18:06:43 +0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12529"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.50.3 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 14 01:51:23 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ra3Ug-00036N-69 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 14 Feb 2024 01:51:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ra3Tv-0000iR-DK; Tue, 13 Feb 2024 19:50:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZuN6-0003eS-P2 for help-gnu-emacs@gnu.org; Tue, 13 Feb 2024 10:06:56 -0500 Original-Received: from forward101c.mail.yandex.net ([178.154.239.212]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZuN1-0005LQ-9i for help-gnu-emacs@gnu.org; Tue, 13 Feb 2024 10:06:56 -0500 Original-Received: from mail-nwsmtp-smtp-production-main-90.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-90.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:2502:0:640:9ff9:0]) by forward101c.mail.yandex.net (Yandex) with ESMTPS id ECDE1608F4 for ; Tue, 13 Feb 2024 18:06:43 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-90.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id h6pjah0Gc0U0-e0zpcxqv; Tue, 13 Feb 2024 18:06:43 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1707836803; bh=vZkl4DT3JKxAHMWVPyXtWi0l689+zPPTrTaDVsIFzY0=; h=Date:To:From:Subject:Message-ID; b=RWhFp5jI69FVrfIrTepUKUjLzCBrDZiC3J3LJR7pW0epTmSxoYiOskdbkDQu/o83D 71de7ZYf/17G5TcXyzOTR/IKQ/86HUf4L6943aZvo1UmdJYztiVU84kKCcUxkNrZmm Ajca7PPtQGWCWcyPu+52HHIupAR6HEswMgQ1AKQc= Authentication-Results: mail-nwsmtp-smtp-production-main-90.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received-SPF: pass client-ip=178.154.239.212; envelope-from=Hi-Angel@yandex.ru; helo=forward101c.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 13 Feb 2024 19:50:29 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145935 Archived-At: I'm writing tests for color-identifiers-mode, and as part of the testing I need to check it reacts correctly to theme being changed. There are already tests that work fine so far, but it turns out `load- theme` doesn't work as is. More specifically, even though `(load-theme 'adwait)` works fine, but background/foreground have no color: emacs -batch --eval "(progn (load-theme 'adwaita) (print (face- attribute 'default :foreground)) (print (face-attribute 'default :background)))" =20 "unspecified-fg" =20 "unspecified-bg" I asked on Emacs stackexchange=C2=B9 and I was hinted that it's because batch-mode doesn't initialize a windowing system. But is there no function I can call to make `load-theme` assign colors as in non-batch mode? P.S.: pls keep in in CC 1: https://emacs.stackexchange.com/questions/80358/unspecified-fg-bg-in-batch-= mode-when-querying-foreground-background-colors/80370#80370