From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#64347: 30.0.50; Some customize faces shown as edited with -Q Date: Fri, 30 Jun 2023 11:05:33 -0300 Message-ID: <28fa0831-bb28-b7c1-1535-3a950f6b2545@gmail.com> References: <87jzvmd17f.fsf@gmx.net> <83cz1etpdm.fsf@gnu.org> <2b6de9de-f33f-0547-eaa0-1f9d24f70115@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33828"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cc: Eli Zaretskii , Stephen Berman To: 64347@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 30 16:06:18 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 1qFElO-0008eP-HF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Jun 2023 16:06:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFElB-0003uO-6l; Fri, 30 Jun 2023 10:06:05 -0400 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 1qFEl8-0003uF-5l for bug-gnu-emacs@gnu.org; Fri, 30 Jun 2023 10:06:02 -0400 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 1qFEl7-0005fU-Tm for bug-gnu-emacs@gnu.org; Fri, 30 Jun 2023 10:06:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qFEl7-0006nD-PR for bug-gnu-emacs@gnu.org; Fri, 30 Jun 2023 10:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Jun 2023 14:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64347 X-GNU-PR-Package: emacs Original-Received: via spool by 64347-submit@debbugs.gnu.org id=B64347.168813394526081 (code B ref 64347); Fri, 30 Jun 2023 14:06:01 +0000 Original-Received: (at 64347) by debbugs.gnu.org; 30 Jun 2023 14:05:45 +0000 Original-Received: from localhost ([127.0.0.1]:55450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFEkq-0006mZ-BI for submit@debbugs.gnu.org; Fri, 30 Jun 2023 10:05:44 -0400 Original-Received: from mail-oa1-f45.google.com ([209.85.160.45]:62609) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFEko-0006mJ-5F for 64347@debbugs.gnu.org; Fri, 30 Jun 2023 10:05:42 -0400 Original-Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-1b0748bc78dso1196952fac.0 for <64347@debbugs.gnu.org>; Fri, 30 Jun 2023 07:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688133936; x=1690725936; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Hoss68T97kWdN8ebZ3qnQn5UEg0VCBgwK696mI2CjKg=; b=JhyAbB09j+MOCs4ActGvvfgF1C+Q+IXFZFJ2kTLI+n9KjqPJSososEiqPHIU28r3TW azhuuMpvjgrWVqxqXRwXMQXaL7U5LdAuO4VYDSuSvxkwkAUyo2ZY3LVRxBOiYA1BNZED cE0qVXsS79fb9mtoE/B9XQggP5XwPOeF/DvJjB7eNsHxy7asdfqROuwlCNqR9RplPLQ5 //JOrBffsv09y7r6g7eoCHR9a4+/zUGm6e8U+rnaBCPXO/I8AW4I1YbVUHmiGMuINsaS vN8T25ZPY8mjTnJQORKd1bzRsz6JQTB3/STwXm6HscbPlp5Yk5AJTFLgA719qsVfk70Y N/Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688133936; x=1690725936; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Hoss68T97kWdN8ebZ3qnQn5UEg0VCBgwK696mI2CjKg=; b=bw/Nf/tWj3gjTI6T/xPAZ9L+oYHrMigTyvWSb8pPNg54osLjHZhHr5wmKJdY0fjL7I 477RqZdgrzmQ72mp5t3cEcOGg1Ripq2c4aAj1oeU6x1L1USY3sCtFKLYoJQR3l9FA9mo AMauFX+2/r1j6eNZ5V7ydCTFk1CmLSaKeyE/i3VB6h6mOpPD5CrllB5dQIm5+DM/QB57 SrlgEgvLYAjvhRTAg8uIocMtgFydp0iKdm8ilQx3x4olM456OYpiKPQud3cixbf2VM3b 0mejKYcq1ykHPNDNA2LDoEuRKwY5z+RQr0QvuTFRJPoATReCnFDcnkZfSpxm/8NewHbx yqow== X-Gm-Message-State: ABy/qLb2vfebpU70WzVDqXiVr1szu429ysgyzx0uOnCrUhC/pxKgfjXM lTxAQrypJqOODEsF/fE2tWsa4NSgmgEg3Q== X-Google-Smtp-Source: ACHHUZ51F3B+DIVjYjx0EZmj3s/k94oXIuAp9j59lFNIFazNb5ngITiDzcjAtBJlsDqohJHXkDk/lw== X-Received: by 2002:a05:6870:f686:b0:1b0:d28:2a76 with SMTP id el6-20020a056870f68600b001b00d282a76mr1714487oab.21.1688133936003; Fri, 30 Jun 2023 07:05:36 -0700 (PDT) Original-Received: from [192.168.0.234] ([186.127.128.249]) by smtp.gmail.com with ESMTPSA id em15-20020a0568705b8f00b0019e6b96f909sm8967640oab.22.2023.06.30.07.05.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Jun 2023 07:05:35 -0700 (PDT) Content-Language: en-US In-Reply-To: <2b6de9de-f33f-0547-eaa0-1f9d24f70115@gmail.com> 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:264317 Archived-At: Mauro Aranda writes: > (And I don't know what's wrong with the confusingly-reordered face yet) OK, some information about the confusingly-reordered face.  Take the definition of the face, only change the name. (defface test   '((((supports :underline (:style wave)))      :underline (:style wave :color "Red1"))     (t      :inherit warning))   "...") And evaluate that in Emacs 27, with -Q.  Then: M-x customize-face RET test Notice that it says Edited, and that the Widget shows the option to modify Underline, Color, Style, as expected. Now take the same definition to Emacs 29, with -Q and do the same. The State is still EDITED (which is wrong, and the cause of the bug report), but now you don't see the option to modify the Underline. Somehow it didn't match.  So there's something different (and still wrong) here going on.  I took a look at why the matching has changed and it looks to me like this code in custom-face-attributes is responsible:      ,(lambda (real-value)     (and real-value          (let ((color             (or (and (consp real-value) (plist-get real-value :color))                 (and (stringp real-value) real-value)                 'foreground-color))            (style             (or (and (consp real-value) (plist-get real-value :style))                 'line))                    (position (and (consp real-value)                                   (plist-get real-value :style))))                (nconc (and color  `(:color ,color))                       `(:style ,style)                       (and position `(:position ,position)))))) (plist-get real-value :style) for position looks like a typo introduced in: commit 4f50d964e51bbe5219f40df4353f4314c7ade985 Author: Po Lu Date:   Mon Jan 10 19:26:46 2022 +0800     Allow controlling the underline position of faces Changing that line to (plist-get real-value :position) brings back the correct match, so that's one less bug. Still, the important one is left.  Now, go back in time to Emacs 27 again, but slightly change the definition for test: (defface test   '((((supports :underline (:style wave)))      :underline (:color "Red1" :style wave))     (t      :inherit warning))   "...") Notice the properties in :underline were swapped. M-x customize-face RET test Shows the Standard State, as expected.  So it seems to me that something somewhere is checking for list equality where it should check for plist equality. With the previous typo fix, go back to Emacs 29 and repeat.  It still shows EDITED as the State, so again, there's something else wrong here. I think what was left out in terms of the :underline property is that :position doesn't have to be always specified.  Changing the filter for the customized-value to return something like this: (nconc `(:color ,color) `(:style ,style) (and position `(:position ,position))) fixes it, now customizing the unedited face shows STANDARD as the state. To sum it up, I think there are bugs in custom-face-attributes. One is most surely a typo, and the other ones are oversights in the filters for the :underline and :box properties.  Fixing those, we are left with one bug, I think, that will be reproducible with Emacs -Q and evaluating: (defface test   '((((supports :underline (:style wave)))      :underline (:color "Red1" :style wave))     (t      :inherit warning))   "...") (defface test-2   '((((supports :underline (:style wave)))      :underline (:style wave :color "Red1"))     (t      :inherit warning))   "...") M-x customize-face RET test will show STANDARD state while M-x customize-face RET test-2 will show EDITED state