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:23:52 +0300 Message-ID: <87pml05p4n.fsf@protesilaos.com> References: <87bkwnj6lw.fsf@protesilaos.com> <83o80lbpy8.fsf@gnu.org> <877d79d3ab.fsf@protesilaos.com> <83k0b9bl55.fsf@gnu.org> <87sfpw5q4n.fsf@protesilaos.com> <835ymsbbsa.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="434"; 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:26:58 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 1nkL1l-000ATx-Vf for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Apr 2022 09:26:58 +0200 Original-Received: from localhost ([::1]:58076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkL1k-0004QZ-IC for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Apr 2022 03:26:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkKyt-0002q7-EB for emacs-devel@gnu.org; Fri, 29 Apr 2022 03:23:59 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:37627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkKyr-0002t2-Dl; Fri, 29 Apr 2022 03:23:59 -0400 Original-Received: (Authenticated sender: public@protesilaos.com) by mail.gandi.net (Postfix) with ESMTPSA id CBA351C0010; Fri, 29 Apr 2022 07:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protesilaos.com; s=gm1; t=1651217034; 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=w7NiIT+YynWfdAhXsOuusvdrKA23PoU5Jk2QdI0db48=; b=gDj22rnSuDoAXwHLGGqMT+IPwc5kY7df+Qhq/8/Wjc54f9glfykBmmPWEoeiVOZY5eXanp +o4h1rcPTlmcm65Tu9X8A0CJq8fFA6AEFQNmmAuC9VOFcq3JMgnnojcpdE0aIkt6fE/AOq E6bCoTnVDbgdkMb8nue/fYllAXB7zVDzdEBZxti/T5K8gOlnuP+YOeCOAQW781NYCw0Sin 8Wk3vPkk6hnsdZHDPuvZ/FT5QAHMzRNHwvRkAoCPWHwqOI0xfE4smxwyBCkI/X8ymAcVb6 1KfZAnqloDcBrvvmsz5MNcYiFYNiXyZE8XVqSKFLlUYFegkEnC4BYBebyvn7Dg== In-Reply-To: <835ymsbbsa.fsf@gnu.org> Received-SPF: none client-ip=217.70.183.197; envelope-from=info@protesilaos.com; helo=relay5-d.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:288961 Archived-At: > From: Eli Zaretskii > Date: Fri, 29 Apr 2022 10:15:33 +0300 > >> > 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? > > What exactly is the "edge case", and why do you need it in this > package? It is possible to have a typeface that has a light weight and another that hasn't. If the user defines two presets in fontaine-presets and tries to switch from the one with the light weight to the other without it, they will encounter the aforementioned behaviour of set-face-attribute. -- Protesilaos Stavrou https://protesilaos.com