Subject: bug#64347: 30.0.50; Some customize faces shown as edited with -Q

From: Mauro Aranda <[email-masked]>
Date: Sat, 15 Jul 2023 17:11:21 -0300

Eli Zaretskii <[email-masked]> writes:

 >> Date: Fri, 30 Jun 2023 11:05:33 -0300
 >> From: Mauro Aranda <[email-masked]>
 >> Cc: Stephen Berman <[email-masked]>, Eli Zaretskii 
<[email-masked]>
 >>
 >> 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
 >
 > Thanks.
 >
 > Can you show a patch for the two bugs you've succeeded to identify?
 >
 > Did you make any progress with the one bug that's left after the other
 > two are fixed?

Here's a patch for the typo.

Concerning the other bugs I discovered, I think that while the filters
could be tweaked, a better fix would be to teach face-spec-match-p
about matching plists correctly and not just by equality.
From 409b59f21fec542e16740bfa62daf09df4cdcecb Mon Sep 17 00:00:00 2001
From: Mauro Aranda <[email-masked]>
Date: Sat, 15 Jul 2023 17:05:23 -0300
Subject: [PATCH] Fix typo in pre-filter for underline property

* lisp/cus-face.el (custom-face-attributes): Fix typo (Bug#64347)
---
 lisp/cus-face.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index ec89b4f7ff6..a3a27263a7c 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -158,7 +158,7 @@ custom-face-attributes
 		    (or (and (consp real-value) (plist-get real-value :style))
 		        'line))
                    (position (and (consp real-value)
-                                  (plist-get real-value :style))))
+                                  (plist-get real-value :position))))
 	       (list :color color :style style :position position))))
      ;; filter to make customized-value suitable for storing
      ,(lambda (cus-value)
-- 
2.34.1