From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58912: 29.0.50; set-face-attribute call in init.el has no lasting effect Date: Tue, 01 Nov 2022 10:58:22 +0800 Message-ID: <875yfzgz3l.fsf@yahoo.com> References: <83sfj4dsp0.fsf@gnu.org> <878rkwhz8o.fsf@yahoo.com> <63430cc7-d940-41c9-4c14-0ff6867134e4@yandex.ru> <874jvjiked.fsf@yahoo.com> <87iljzh4ia.fsf@yahoo.com> <87r0yns9du.fsf@rfc20.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22280"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 58912@debbugs.gnu.org, Dmitry Gutov To: Matt Armstrong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 01 03:59:15 2022 Return-path: Envelope-to: geb-bug-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 1ophUh-0005ZF-4d for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Nov 2022 03:59:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ophUW-0008ED-8E; Mon, 31 Oct 2022 22:59:04 -0400 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 1ophUU-0008Dd-TY for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 22:59:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ophUU-0000AP-JG for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 22:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ophUU-0002s8-5v for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 22:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Nov 2022 02:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58912 X-GNU-PR-Package: emacs Original-Received: via spool by 58912-submit@debbugs.gnu.org id=B58912.166727152511016 (code B ref 58912); Tue, 01 Nov 2022 02:59:02 +0000 Original-Received: (at 58912) by debbugs.gnu.org; 1 Nov 2022 02:58:45 +0000 Original-Received: from localhost ([127.0.0.1]:42349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ophUD-0002rb-Cd for submit@debbugs.gnu.org; Mon, 31 Oct 2022 22:58:45 -0400 Original-Received: from sonic314-22.consmr.mail.ne1.yahoo.com ([66.163.189.148]:43683) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ophUB-0002rO-N3 for 58912@debbugs.gnu.org; Mon, 31 Oct 2022 22:58:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1667271517; bh=PpKBmtizh2EJOgXFaZMv21l5uiPnSXRoFhedioZ2+sI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=bmfAwlZcTvv7YfFx9Ik/+4QArKzouoDmYsKTK2yGYvQxEvVOuSFTPmpGkBC+x/n6uxpHQNbkBxzea7oKXQjspKaVKRT4+AKigBW/gKW98Cq5mecePSAUOSGZaUVucU1RATW4KCr6l8iRxsPEzagkjOYTeF5Sco/HJ12cKquNJfBsfxavkZuZ+ml+FlZQ1/EC8Er+i2advZWYd9hyyAAtG9vYqB5/9wb7ZwlzLWitdU0zPd3IPTp3e+XnISwdQi58tIbxIm7PubkkCU1zxd/TctHwWUqjP6q5u/jaWVsrgDuMXUSQ1gdbqqOnDaVYA2MUS687C23bTrRjEdRyCXClKQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1667271517; bh=UrjN6EEutUdjoq+rwUssxGbe5U7uoSIQIJIpwpMgjlI=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=JTlXjMSlHZg+NMse90kFDluM1hexmQuBZ8GSyT5N7HfwcFHBzOO9c7R2lm/j0+wQRA5gUnse5chz3UEAQE9wBq0/n5qmH76jnUL6G71TllO+kdbDuo+YssD+185BMzqvao/K0zui6JdfRFzU1zY1On3FvebCI8r0NOEvn16q41xSYUwIOZ/nU7vfPOljsY56DUvXP0hMjA49ZvJq27yCwihFJnXAWpJ1bCDjmtFcQJfFZOcCwbu8JDzGjNPia80KLtHZh41cXBCkNtuCtCYyHuCo7wKOmkSkrJPO5NAl5wiXTO4XIYwkKcPA8/6GfUUSV3ZkrI+QFwBQDjyp0M9tkA== X-YMail-OSG: z0Z30TUVM1m6I_fVVNiaxxXW1QIaylIp9EL0nvNuR9iWAo04X4elbUm6OTm7frF YrEp.iB6nDOd9Nrnp_ICcc_EPWBboyPuwnXjJkSPJ0rK5p9En26NdXSwcohMamiIT5Zgn.p.JqVy wqrCbpfKY.jCSQbrx253zBt9OGZKuSFGbJwScHKxQpEGHM1lFEcThL2.gmdeQ5NDtke9YeBBn1et U.Frr1hZfa3U62d69NkenExI6lDslyayIxW2m.cjpEFoz1AhypdUaLSr7ltFO44oedbZ_T7._NEw OI1lhgErmEWZcWsjT5YW8j6brqBPKp3lYi1l7HoT4Z.I_P1bWZ.YkLqJY2TSEfeumOTUAIUhg6Z7 L6ydBT9ACkoZb9.JkFBmWBDiyAxUieQVTC_tHsjQX1FMoOa5.hZ62M88tgCzk4iAR_YWVM6zIrR9 zaZNXX257RxxYuODZnFAAZsCQTjbB.KxD54v35vN.q9c_jSseBMKqS0oZBOJOxY81cTdW7w.R.Jx KGoVGx3959PIJugZNSpkXStXlhRX_Taum8Yvzr6XCoI8Q8LBYBtAoK6okVlmhLeCikfNxAEoASJk sMzct4aWGqB3kOHTKqnt4O3eH7k1xbmnFrvakUYYc4ztPhUgyc5lfXl2iwK_gSbXiQXDdpy_tT_D 5BQg4uSzUrLv6oXUNUMXOxA2Lky6cY.ViC2W_XjSqrKsGwUbzAXIxPQW5r0CCd27lWgcmat2sg0m sv.ZuHGGbufMVe9oBb_h.CtK17F3qKdlKVdQyhb7pawGC4ea7tSMYPAcsyIoOwYZzzT7kzWdP8IM nC37XKLWLzdYFQ4O3DxqYss5NgZfMgIfHwvfUcuwv_ X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Tue, 1 Nov 2022 02:58:37 +0000 Original-Received: by hermes--production-sg3-74fb94585-g2qrq (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 3a465e412eaf02b267e38863424672c1; Tue, 01 Nov 2022 02:58:30 +0000 (UTC) In-Reply-To: <87r0yns9du.fsf@rfc20.org> (Matt Armstrong's message of "Mon, 31 Oct 2022 19:20:45 -0700") X-Mailer: WebService/1.1.20783 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246740 Archived-At: Matt Armstrong writes: > I see the same symptoms as Dmitry. I'm running a current Debian Testing > system, Gnome, Wayland. > > Namely: > > 1) emacs -Q --> the 'default font family is the Gnome system monospace font. > > 2) emacs -Q -l test.el --> still uses the Gnome system mono font despite > setting the 'default face otherwise early in init. > > I changed the .el file to this: > > (set-face-attribute > 'default nil :height 110 :weight 'semi-light :family > "Cascadia Mono") > (debug-on-entry #'set-face-attribute) > > And the origin of the font change back to the system defaults is this: > > Debugger entered--entering a function: > * set-face-attribute(default # :width normal :weight normal :slant normal :font "Go Mono 11") > font-setting-change-default-font(":0" nil) > dynamic-setting-handle-config-changed-event((config-changed-event font-render ":0")) > funcall-interactively(dynamic-setting-handle-config-changed-event (config-changed-event font-render ":0")) > call-interactively(dynamic-setting-handle-config-changed-event nil [(config-changed-event font-render ":0")]) > command-execute(dynamic-setting-handle-config-changed-event nil [(config-changed-event font-render ":0")] t) > > It looks like `font-setting-change-default-font' is pulling the system > font (in my case "Go Mono") from the frame, which probably wasn't > modified by the earlier `set-face-attribute` call. To confirm I changed > test.el to this: > > (set-face-attribute > 'default nil :height 110 :weight 'semi-light :family > "Cascadia Mono") > (dolist (frame (frame-list)) > (let ((frame-font > (or (font-get (face-attribute 'default :font frame 'default) > :user-spec) > (frame-parameter frame 'font-parameter)))) > (message "frame %S frame-font %S" frame frame-font))) > > And re-run "emacs -Q -l test.el" and get this in *Messages*: > > frame # frame-font "Go Mono 11" > > So I change test.el yet again to have only this: > > (set-frame-font "Cascadia Mono") > > ...and that font change sticks. `set-frame-font` is what is called by > the Options -> Set Default Font menu item and has logic to walk through > frames and set their parameters accordingly. > > And again to have only this: > > (set-frame-font (font-spec :height 110 > :weight 'semi-light > :family "Cascadia Mono")) > > > ...I wonder if setting the 'default face attribute in 'early-init.el' > would be enough, too. Doesn't it only do that if font-use-system-font is t? Here is the relevant part of dynamic-setting.el: ;; Just redraw the existing fonts on all frames: (dolist (f frame-list) (let ((frame-font (or (font-get (face-attribute 'default :font f 'default) :user-spec) <===== this should return "Cascadia Mono"... what does it return for you?