From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#59347: 29.0.50; `:family` face setting ignored Date: Mon, 12 Dec 2022 16:12:22 +0000 Message-ID: References: <83tu2t4ie9.fsf@gnu.org> <7cc9e03786e324ff82ef@heytings.org> <83bkp04gjl.fsf@gnu.org> <83leo42vm9.fsf@gnu.org> <0d1ea3007fd94b7ae0b1@heytings.org> <83r0xv1649.fsf@gnu.org> <0d1ea3007f532a493429@heytings.org> <83cz9f12bh.fsf@gnu.org> <835yewleyn.fsf@gnu.org> <83tu2b9rlx.fsf@gnu.org> <83k0347gtu.fsf@gnu.org> <83v8mm2ug7.fsf@gnu.org> <83cz8u2d6u.fsf@gnu.org> <831qp93nsc.fsf@gnu.org> <1a7e3acf3578520feda7@heytings.org> <831qp4slt0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31721"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, monnier@iro.umontreal.ca, 59347@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 12 17:13: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 1p4lQZ-00083m-0H for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Dec 2022 17:13:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4lQO-00041v-9w; Mon, 12 Dec 2022 11:13:04 -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 1p4lQM-00040P-FD for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2022 11:13:02 -0500 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 1p4lQM-0006HB-7B for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2022 11:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p4lQM-0000JQ-2d for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2022 11:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Dec 2022 16:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59347 X-GNU-PR-Package: emacs Original-Received: via spool by 59347-submit@debbugs.gnu.org id=B59347.16708615461173 (code B ref 59347); Mon, 12 Dec 2022 16:13:02 +0000 Original-Received: (at 59347) by debbugs.gnu.org; 12 Dec 2022 16:12:26 +0000 Original-Received: from localhost ([127.0.0.1]:53855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4lPm-0000Ir-3O for submit@debbugs.gnu.org; Mon, 12 Dec 2022 11:12:26 -0500 Original-Received: from heytings.org ([95.142.160.155]:55012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4lPk-0000Il-9b for 59347@debbugs.gnu.org; Mon, 12 Dec 2022 11:12:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1670861542; bh=/r/1rm35iOhA7z52AZ+vV+LdBcrZjt0X7EMGHXLMAmA=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=oLtWWTFC5tQUvK/i8W/eBjahIUfCPED7F+Rj0M+vwR1lbk32VAkxrU97/i5GCis+A vNOWsSY62mHtc+1LkbddcHRwO+F+QbVW6CWXFaJOPvnAlIWjfAy0C4EAO4652rzAgy jRB+Obot+2IIctW/Ozu5ETqJNaRb1/5MOeAvyfH1sU03TWZ9qWFqglicqJ2nQlsDYL Fp6gXaVxEFR7edowk90vDny+ScK5d3mD5nM9SDrnSKmXStZ1jqxPVFJqgJe3vbaDom +cKC9QSo1L1ZbQlg7LHzClixVNFH5/vOkKCLQlVnkdblLkAmpggfBvW9ucDwljXlo7 JFMKAv5SzofEQ== In-Reply-To: <831qp4slt0.fsf@gnu.org> 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:250716 Archived-At: > > your reaction, in particular the revert, is also overreaction. > Okay. But note that it wasn't a blunt revert, it was accompanied with a long, precise, detailed rationale. Unlike the commit it reverted, and the revert revert. >> The fundamental problem I have with the doc string is that it did not >> say what it does, or what it is supposed to debug, in a manner users >> can understand. > > Does the current doc string have any such problems you can spot? > Yes. The gist of the original docstring, which was correct (and I think understandable even by non-experts), is this: "When the font chosen for the default face has a weight, slant or width that is not supported by other available fonts on the system, such as 'medium', Emacs may select suboptimal fonts for other faces." As I explained, the root of this bug is an undesirable interaction with the weight/slant/widht (and possibly other attributes, time will tell us) of the _default_ face, when they are set to unusual/less common values, with the fonts that are selected for _other faces_ in which these attributes are _unspecified_. That is a very specific corner case, and the current variable name and docstring does not reflect this (namely, that it's a very specific corner case, in a very specific area of code). The current docstring means something completely different. Saying for example that "face attributes will be treated as "soft" constraints when looking for suitable fonts: if an exact match is not possible, a font can be selected that is a close, but not an exact, match" means that when an attribute is _specified_ Emacs will treat that attribute value in a lax manner, which is already (and has always been) the case, and when the purpose of that variable is to affect font selection for faces whose attributes are _unspecified_. This was also important: "There is no reason to change that value except for debugging purposes." Of course users are free to ignore that warning, but at least they have been warned. > > Anyway, here's my proposal: > > . we change the default value of the variable to be t, and document that > this stands for (:weight :width :slant) > > . we change the code to reset only those 3 attributes when the value is > t, and to reset nothing when the value is nil > > . the (slower) code which loops over the list will only run if the value > of the variable is neither nil nor t > > . we avoid resetting the :extra attribute on Haiku > As long as we don't traverse a Lisp list each time a face is realized in the default case, I'm fine with this. I think Stefan's proposal (write an Elisp-level interface) is slightly better, though, because if we find out in Emacs 30 or 31 that some other attribute must also be unset, the meaning of 't' would have to change.