From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Protesilaos Stavrou Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] Add fontaine package? Date: Fri, 29 Apr 2022 10:02:16 +0300 Message-ID: <87sfpw5q4n.fsf@protesilaos.com> References: <87bkwnj6lw.fsf@protesilaos.com> <83o80lbpy8.fsf@gnu.org> <877d79d3ab.fsf@protesilaos.com> <83k0b9bl55.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2866"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.35 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 29 09:04:20 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nkKfr-0000aE-PC for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Apr 2022 09:04:19 +0200 Original-Received: from localhost ([::1]:36432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkKfq-0005lI-D4 for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Apr 2022 03:04:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkKe2-0004ts-KB for emacs-devel@gnu.org; Fri, 29 Apr 2022 03:02:26 -0400 Original-Received: from relay12.mail.gandi.net ([2001:4b98:dc4:8::232]:40597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkKdz-0007iO-1e; Fri, 29 Apr 2022 03:02:26 -0400 Original-Received: (Authenticated sender: public@protesilaos.com) by mail.gandi.net (Postfix) with ESMTPSA id D28A2200009; Fri, 29 Apr 2022 07:02:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protesilaos.com; s=gm1; t=1651215738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oAs1ctd8nJiruSK6Tmfxrls1hhmuwnqRcRaMVcuYNnU=; b=fXR4MMIp3/jM9E8p54W/m56zpkfn6nzpjarG6LWu426ugvTexZZ6LeEjzREL3DSx4FUAee JLjrnALbWuGVcy9EwmmwDX9UzNco9H3NRwUToXD08YnI47UEwPBISE9C8TiaWM1VCECePS 6zsbmnY7LB1KT6dI6S7aeKn+v53BmfE8DgxtVtjNocFcdLoT1p0HjeNgKJln5njO3D07D/ vXBPAZy3LYsNFAh1fgUGhv2IwYUINd3sCyty0fw5a0GA7jU+/eG82nQBDHXsD1aFa6pm9A 3czr3kwOZ4mB1zDnNYfVIU4Usg73TOEMP7TOd9oHWCAwECC97Itkyrw8+H9Hpw== In-Reply-To: <83k0b9bl55.fsf@gnu.org> Received-SPF: none client-ip=2001:4b98:dc4:8::232; envelope-from=info@protesilaos.com; helo=relay12.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:288958 Archived-At: > From: Eli Zaretskii > Date: Thu, 28 Apr 2022 12:41:10 +0300 > >> From: Protesilaos Stavrou >> Cc: emacs-devel@gnu.org >> Date: Thu, 28 Apr 2022 11:23:56 +0300 >> >> > . It uses internal-set-lisp-face-attribute, which is an internal >> > primitive, something I'd suggest to avoid. Why can't it use >> > set-lisp-face-attribute instead? >> >> I do not have 'set-lisp-face-attribute' on my end (Emacs 29, GNU/Linux). > > Sorry, I meant set-face-attribute, of course. The reason I did not use it is due to what we discussed in bug#45920. Basically, set-face-attribute needs to be evaluated twice when (i) we change the :family, (ii) change the :weight, and (iii) the new family does not have the weight of the previous one. The example I used in that bug report, which I can still reproduce with emacs -Q: ;; Sample 1 (set-face-attribute 'default nil :family "Source Code Pro" :weight 'light) ;; Sample 2 (set-face-attribute 'default nil :family "Hack" :weight 'normal) Evaluate sample 1. It works. Now evaluate sample 2. Notice that it does not yield the expected result. Evaluate sample 2 again: the result is the desired one. By using internal-set-lisp-face-attribute, I specify the sequence of events that always works. Perhaps there is a better way to handle this edge case? -- Protesilaos Stavrou https://protesilaos.com