From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#68042: 30.0.50; `face-font' returns nil after adding remap relative for fontset Date: Tue, 26 Dec 2023 19:49:09 +0200 Message-ID: <83zfxw97my.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20936"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68042@debbugs.gnu.org To: Hanwen Guo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 26 18:50:15 2023 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 1rIBZH-0005Dz-4y for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Dec 2023 18:50:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rIBZ8-0005qF-IF; Tue, 26 Dec 2023 12:50:06 -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 1rIBZ6-0005pU-Mc for bug-gnu-emacs@gnu.org; Tue, 26 Dec 2023 12:50:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rIBZ5-000898-P1 for bug-gnu-emacs@gnu.org; Tue, 26 Dec 2023 12:50:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rIBZ3-0006iM-Rj for bug-gnu-emacs@gnu.org; Tue, 26 Dec 2023 12:50:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Dec 2023 17:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68042 X-GNU-PR-Package: emacs Original-Received: via spool by 68042-submit@debbugs.gnu.org id=B68042.170361297525762 (code B ref 68042); Tue, 26 Dec 2023 17:50:01 +0000 Original-Received: (at 68042) by debbugs.gnu.org; 26 Dec 2023 17:49:35 +0000 Original-Received: from localhost ([127.0.0.1]:34916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIBYc-0006hQ-Vo for submit@debbugs.gnu.org; Tue, 26 Dec 2023 12:49:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42390) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIBYa-0006hA-SV; Tue, 26 Dec 2023 12:49:33 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rIBYX-0007ys-A4; Tue, 26 Dec 2023 12:49:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=GKjWs4iLbBpgvdQo+xFJ5YANrhRaQ6o+bsM6g8egndI=; b=SaUeeQoV0qcR61Ew3jRt IlXrwCISKXPMviwBNutn87U/XuXsibNwNhGnrFPSox1wnehC8/4tLRYAU1RCwp2S0C0jbZBHE8kqn a+J0vXrDn/mpmG2MTqqU4QxX3Y/8G/CjdYQ0TQlUMTw5JxY+oCIqvgm4QVtfTnIn0hus0vmqRMKNY 8NOKwgGCDQ+M0lNj4+nn7l2zJXpjOIJUQ+1edwLJerGJ924cE0fRZDEhlLGIdExl3wwuajxCBZQwb 8b/7vlcfSbQc9GU49fZ+mTwcfRclx1nTfJFIL/K0WAxNaN448GA2ThT1vtWBg35+KoqJtKD7bKgzk k2S6+AGhq9jlbw==; In-Reply-To: (message from Hanwen Guo on Tue, 26 Dec 2023 11:47:22 +0000) 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276918 Archived-At: tags 68042 notabug thanks > From: Hanwen Guo > Date: Tue, 26 Dec 2023 11:47:22 +0000 > msip_labels: > > Providing the `:fontset' or `:font' face attribute in the `SPEC' > argument of `face-remap-add-relative' with `FACE' argument being > `'default' will make the `face-font' function return nil. > > The following Emacs Lisp code can reproduce this behavior under 'emacs > -Q'. > > (create-fontset-from-fontset-spec >  (font-xlfd-name >   (font-spec :family "Source Serif" >              :registry "fontset-variable pitch regular"))) > > (set-face-attribute 'variable-pitch nil >                     :family "Source Serif" >                     :fontset "fontset-variable pitch regular") > > (let ((var-pitch (face-attribute 'variable-pitch :family)) >       (var-fontset (face-attribute 'variable-pitch :fontset))) >   (setq mixed-pitch-variable-cookie >         (face-remap-add-relative 'default :family var-pitch :fontset var-fontset))) > > (face-font 'default) ;; nil > > (face-remap-remove-relative mixed-pitch-variable-cookie) > > (face-font 'default) ;; non-nil Don't use :fontset as a face attribute; use :font instead. The value of :font can be a fontset, so you don't need to use the (obsolete and not really supported) :fontset attribute. The doc string of set-face-attribute documents :font, not :fontset, and that is not an accident. If you replace all instances of :fontset above with :font, fac-font will not return nil. This is not a bug.