From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#37774: 27.0.50; new :extend attribute broke visuals of all themes and other packages Date: Fri, 6 Dec 2019 18:58:26 +0200 Message-ID: <6c68ceed-156c-a6f2-bf0f-21d7e9eb5692@yandex.ru> References: <87o8xwrjba.fsf@bernoul.li> <834kzooo8e.fsf@gnu.org> <877e4d7yzf.fsf@bernoul.li> <83imnvg53q.fsf@gnu.org> <87zhh2ofc9.fsf@bernoul.li> <87k186nsku.fsf@bernoul.li> <87imna18nc.fsf@mail.linkov.net> <42c596c2-b5c1-9fc9-4b92-9c13b386d93d@yandex.ru> <83pnhgrlni.fsf@gnu.org> <83ftiasfdm.fsf@gnu.org> <83lfrulmva.fsf@gnu.org> <76a012f5-8cdd-75d5-322e-a453a612c655@yandex.ru> <83immxjs6q.fsf@gnu.org> <993b2f9c-6052-e791-3d3b-26d5fedd7d12@yandex.ru> <835ziuixke.fsf@gnu.org> <9c4768a5-ecce-68ce-c612-a001b2f6784d@yandex.ru> <8336dxh1ge.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="268542"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 Cc: 37774@debbugs.gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 06 18:33:20 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1idHTh-0017f7-4L for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Dec 2019 18:33:17 +0100 Original-Received: from localhost ([::1]:42074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idHTf-0007GL-60 for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Dec 2019 12:33:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41792) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idGwa-0005Zf-7p for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:59:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idGwY-00007i-PC for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:59:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41004) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1idGwY-00006i-G3 for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1idGwY-0007HF-Dw for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Dec 2019 16:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37774 X-GNU-PR-Package: emacs Original-Received: via spool by 37774-submit@debbugs.gnu.org id=B37774.157565151827904 (code B ref 37774); Fri, 06 Dec 2019 16:59:02 +0000 Original-Received: (at 37774) by debbugs.gnu.org; 6 Dec 2019 16:58:38 +0000 Original-Received: from localhost ([127.0.0.1]:46977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idGwA-0007G0-9C for submit@debbugs.gnu.org; Fri, 06 Dec 2019 11:58:38 -0500 Original-Received: from mail-ed1-f45.google.com ([209.85.208.45]:34033) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idGw7-0007FF-PP for 37774@debbugs.gnu.org; Fri, 06 Dec 2019 11:58:36 -0500 Original-Received: by mail-ed1-f45.google.com with SMTP id cx19so6398217edb.1 for <37774@debbugs.gnu.org>; Fri, 06 Dec 2019 08:58:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fiP1iheg0IFVajF5+OnBgeEjMkHfqD6XllG8EazWpKI=; b=IVI7ikKGkJkILCIeY3ed2wllhEzqyWI+k3XBKKCXvcErsfATDWOwG+4b3w+rdI8ip+ GljxeZM12pq8kzmnAlwx9MKag83A6SIif/qvRICBHyRBjgIk9901xETbHhg1Yupx94Pe JqSIB70fNDkjQBvflBMdxFfk5r2CtT22F9rLRAbEZlstN9rcmdci5elhrUeamHyCq8BB 0dhWgHorrB+3NDjqyrh4QF5+nbnWjgsR9avzhOpMNa+sweDp/VAkoLvPvcO5GbXPHLKC teeZ4Jw2aOBmeiefvlUXoRAmeXmnGOwP+llNhDthvQSvattIK2mHxAFTzY48BjjoCTjg vlTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fiP1iheg0IFVajF5+OnBgeEjMkHfqD6XllG8EazWpKI=; b=qUpt8uEbvV4sfZ0fbIRkJ8vkcwnnBUjruwubkNAwq9JdhtGLL9KP0zzG7li9MAT6LT 1tiytmi0FSt5LtECtECq1van504ihPFZWOVsgwjuNCATOTUJKKgeOUEka7TrcPIRyaMO i/NNO31gUC4AOiRUR5dI+qJMVTMvZfoKEhK3YkF4pFMWaaVMXlX08Wu5K+7nPFiU/YWO E7WxarECFH6N1EYf3Pxgq/yWUds9TloPjdcph8fRfmKRS+j7uiH17ozI8+DdKQcS+yGd Fromw1ysgmBH6xY6udC1dGNiAJbCmAC6PGMkRiX0ua3zA3ZFj2y8n0hfGgKQZy3INchO gH4w== X-Gm-Message-State: APjAAAWhQ8vSXgDL2SuISR3xvZ4YLczMgV4mQo7kMg5ZQPKkgoCdQUob v/vD6NwJjahbKW3n7+xBfZg= X-Google-Smtp-Source: APXvYqyH7kQoNkoCfKpxxywqnRrd8tK7eOVJnApBvcr/PHQcuWraw4+xI08+Ix8I0qI3SwCh35QpAw== X-Received: by 2002:a50:9fe7:: with SMTP id c94mr17493872edf.115.1575651509838; Fri, 06 Dec 2019 08:58:29 -0800 (PST) Original-Received: from [192.168.0.149] ([109.110.245.170]) by smtp.googlemail.com with ESMTPSA id h18sm232845ejf.54.2019.12.06.08.58.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Dec 2019 08:58:28 -0800 (PST) In-Reply-To: <8336dxh1ge.fsf@gnu.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:172961 Archived-At: On 06.12.2019 18:18, Eli Zaretskii wrote: >> Cc: 37774@debbugs.gnu.org, juri@linkov.net >> From: Dmitry Gutov >> Date: Fri, 6 Dec 2019 17:44:33 +0200 >> >> It's great that you mentioned face-spec-recalc. It looks just like the >> place to change, since both defface and theme definitions and >> customizations go through it. >> >> We can implement in there a new kind of "face spec" along the lines of >> my previous description, or simply special-case the :extend attribute, >> and take it from the default spec. The latter option is implemented in >> the attached patch, which seems to work in my limited testing. > > Thanks, but is it clean enough to do such exemption for :extend? I think so. Most importantly, it will save a lot of people the trouble of adapting to the current change, limiting the necessary efforts to just package authors (and Emacs core, of course). Further, as you noted in https://debbugs.gnu.org/37774#404, :extend is somewhat special, in that we really want its values to be consistent, so the results look uniform. It's not the only attribute like that, but for others we have different way to ensure that, such as having a default face (where font face, height, etc, are usually customized, instead of doing that in all individual faces). > And if we want to do this, why do it in face-spec-recalc and not in > custom-set-faces itself? Not the place to do that. custom-theme-set-faces saves the specs defined by the theme (or user customization) to the face's symbol property, and then leaves it to face-spec-recalc to combine and apply all the specs related to the face. > The latter will not risk producing > unintended consequences for callers of face-spec-recalc other than > custom-set-faces. I think the purpose of face-spec-recalc is clear enough. So I'd like to see at least one of those "unintended consequences". >> - ;; defface spec entirely (rather than inheriting from it). If >> - ;; there was no spec applicable to FRAME, apply the defface spec >> - ;; as well as any applicable X resources. >> + ;; defface spec entirely rather than inheriting from it, with the >> + ;; exception of the :extend attribute (which is inherited). > > You slightly modified the syntax of the comment, probably a typo. I inserted an empty line for clarity (IMHO), but I certainly do not insist on it. There would be other documentation changes required, too. >> + (when (and theme-face-applied (not themed-extend-attr)) >> + (let ((extend-p (plist-get default-attrs :extend))) >> + (and extend-p (face-spec-set-2 face frame '(:extend t))))) > ^^^^^^^^^^^^ > I think this should be extend-p instead, because the face's default > spec could legitimately say ":extend nil". Right? But that's the default value of that attribute. If faces didn't specify it either, there's nothing to change, right?