changeset 30971:9a23751378f3

(face-attr-match-p): Don't return true if ATTRS are merely a subset of FACE's attributes.
author Miles Bader <miles@gnu.org>
date Sun, 20 Aug 2000 11:58:46 +0000
parents 6b5d76c2bc28
children e3ff4aef71a1
files lisp/faces.el
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/faces.el	Sun Aug 20 08:30:05 2000 +0000
+++ b/lisp/faces.el	Sun Aug 20 11:58:46 2000 +0000
@@ -1179,7 +1179,7 @@
 
 
 (defun face-attr-match-p (face attrs &optional frame)
-  "Value is non-nil if attributes of FACE match values in plist ATTRS.
+  "Return t if attributes of FACE match values in plist ATTRS.
 Optional parameter FRAME is the frame whose definition of FACE
 is used.  If nil or omitted, use the selected frame."
   (unless frame
@@ -1188,14 +1188,15 @@
 	(match t))
     (while (and match (not (null list)))
       (let* ((attr (car (car list)))
-	     (specified-value (plist-get attrs attr))
+	     (specified-value
+	      (if (plist-member attrs attr)
+		  (plist-get attrs attr)
+		'unspecified))
 	     (value-now (face-attribute face attr frame)))
-	(when specified-value
-	  (setq match (equal specified-value value-now)))
+	(setq match (equal specified-value value-now))
 	(setq list (cdr list))))
     match))
 
-
 (defun face-spec-match-p (face spec &optional frame)
   "Return t if FACE, on FRAME, matches what SPEC says it should look like."
   (face-attr-match-p face (face-spec-choose spec frame) frame))