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: Wed, 27 Dec 2023 15:30:24 +0200 Message-ID: <83plyr93in.fsf@gnu.org> References: <83zfxw97my.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7183"; 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 Wed Dec 27 14:31:43 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 1rIU0d-0001lU-Lq for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Dec 2023 14:31:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rIU0L-0005kM-DC; Wed, 27 Dec 2023 08:31:25 -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 1rIU02-0005jh-93 for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2023 08:31:07 -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 1rIU00-0007n7-5m for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2023 08:31:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rITzy-0007nF-FR for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2023 08:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Dec 2023 13:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68042 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 68042-submit@debbugs.gnu.org id=B68042.170368385429038 (code B ref 68042); Wed, 27 Dec 2023 13:31:02 +0000 Original-Received: (at 68042) by debbugs.gnu.org; 27 Dec 2023 13:30:54 +0000 Original-Received: from localhost ([127.0.0.1]:35518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rITzp-0007XM-IG for submit@debbugs.gnu.org; Wed, 27 Dec 2023 08:30:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rITzn-0007Kf-76 for 68042@debbugs.gnu.org; Wed, 27 Dec 2023 08:30:51 -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 1rITzd-0007lp-Su; Wed, 27 Dec 2023 08:30:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=1tJcIs+gQnLHsoZExnwch0Bwm79yXJLkqxseQX4OEVw=; b=L2/ZOA4OlpOl XgYmgvCz5BG2CusAnMrsDbbeWaYhSElCCP1VEpyCLnX2OdeFn2oJxOnyGWhgh2dQ2AZeV0njB7v98 ieaErVUEYYoMhr+ijwrKH3ZordDSGATOWHypp44nueS2sMfsy5vHXmd5+aItS2HAnV1bjN/00KZnc ANduzW2ghgFL/KziLyrGsS8owD5UCziOpHDCZjUCV7qOSuQH1MJ9s5hnaTqfq1+h8kLBfCY3DEPts LVaqbn4hZKiM4khDWNnhqObSsrwQfOlxWHapNJCypyYNU0G9E5IcCO3Op6HQt9hININDNfmbLpqyZ IoCFqtmB0ztPbTEg/goVSw==; In-Reply-To: (message from Hanwen Guo on Wed, 27 Dec 2023 06:43:46 +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:276937 Archived-At: > From: Hanwen Guo > CC: "68042@debbugs.gnu.org" <68042@debbugs.gnu.org> > Date: Wed, 27 Dec 2023 06:43:46 +0000 > > > If you replace all instances of :fontset above with :font, face-font > will not return nil. > > Actually, if you pass the fontset through the `:font' attribute, only the ASCII font from the fontset is > used. Yes, because the faces that are exposed to Lisp are always the faces used for characters supported by the "ASCII font" of a face. For other characters, Emacs creates internally a separate face, which is not exposed to Lisp, and determines its font from the fontset in effect, merging the other relevant face attributes to produce a face as similar as possible to the one used for characters covered by the "ASCII font". > This applies to both `set-face-attribute' and `face-remap-add-relative'. AFAIU, I think when it > comes to the face attributes, the fontset feature is more like a way to set different font for diferent > character sets, making it able to "display the whole range of characters that Emacs supports" for a > given face, since setting the `:family' attribute or assigning a single font to `:font' would suffice for > setting font only for ASCII characters. So the case is, either the `:font' attribute needs to consider the > full fontset, or the whole fontset feature is, as you said, "obsolete". Then please explain in more detail what you are trying to achieve, and why. The code snippet you presented makes it hard to guess, since it defines a face with a special fontset, and then remaps the 'default' face to that face. Why would you need to do that, instead of simply customizing the default-fontset or setting the :fontset attribute of the 'default' face? The technical reason for what you see is that face-remapping creates an anonymous face with the specified attributes, and Emacs doesn't support the :fontset attribute for anonymous faces. But since I don't really understand why you use face-remap-add-relative, I cannot tell whether this is a problem or how to solve it for your needs.