]> code.delx.au - gnu-emacs/blobdiff - lisp/faces.el
(next-line-add-newlines): Change default to nil.
[gnu-emacs] / lisp / faces.el
index 1f86b0c007505baa127e4d29c575e158c5249d70..e899959400692982cb276dc67aaebf85fe12eb6e 100644 (file)
@@ -357,7 +357,10 @@ If FRAME is omitted or nil, use the selected frame."
 If the optional argument FRAME is given, report on face FACE in that frame.
 If FRAME is t, report on the defaults for face FACE (for new frames).
 If FRAME is omitted or nil, use the selected frame."
-  (internal-get-lisp-face-attribute face :foreground frame))
+  (let ((value (internal-get-lisp-face-attribute face :foreground frame)))
+    (if (eq value 'unspecified)
+       nil 
+      value)))
 
 
 (defun face-background (face &optional frame)
@@ -365,7 +368,10 @@ If FRAME is omitted or nil, use the selected frame."
 If the optional argument FRAME is given, report on face FACE in that frame.
 If FRAME is t, report on the defaults for face FACE (for new frames).
 If FRAME is omitted or nil, use the selected frame."
-  (internal-get-lisp-face-attribute face :background frame))
+  (let ((value (internal-get-lisp-face-attribute face :background frame)))
+    (if (eq value 'unspecified)
+       nil
+      value)))
 
 
 (defun face-stipple (face &optional frame)
@@ -373,7 +379,10 @@ If FRAME is omitted or nil, use the selected frame."
 If the optional argument FRAME is given, report on face FACE in that frame.
 If FRAME is t, report on the defaults for face FACE (for new frames).
 If FRAME is omitted or nil, use the selected frame."
-  (internal-get-lisp-face-attribute face :stipple frame))
+  (let ((value (internal-get-lisp-face-attribute face :stipple frame)))
+    (if (eq value 'unspecified)
+       nil
+      value)))
 
 
 (defalias 'face-background-pixmap 'face-stipple)
@@ -1488,14 +1497,16 @@ Initialize colors of certain faces from frame parameters."
                  (scroll-bar-foreground scroll-bar :foreground)
                  (scroll-bar-background scroll-bar :background)
                  (mouse-color mouse :background))))
-    (while params
-      (let ((param-name (nth 0 (car params)))
-           (face (nth 1 (car params)))
-           (attr (nth 2 (car params)))
-           value)
-       (when (setq value (frame-parameter frame param-name))
-         (set-face-attribute face frame attr value)))
-      (setq params (cdr params)))))
+    (dolist (param params)
+      (let ((frame-param (frame-parameter frame (nth 0 param)))
+           (face (nth 1 param))
+           (attr (nth 2 param)))
+       (when (and frame-param
+                  ;; Don't override face attributes explicitly
+                  ;; specified for new frames.
+                  (eq (face-attribute face attr t) 'unspecified))
+         (set-face-attribute face frame attr frame-param))))))
+
 
 (defun tty-handle-reverse-video (frame parameters)
   "Handle the reverse-video frame parameter for terminal frames."