]> code.delx.au - gnu-emacs/blobdiff - lisp/cus-face.el
* lisp/comint.el (comint-dynamic-complete-as-filename)
[gnu-emacs] / lisp / cus-face.el
index 0a48c0fbd685bf9b81f6863d831fd834f270fdbb..90f21f321497f1a5d8ae5e6c19f266c17a7aab7d 100644 (file)
 (defun custom-declare-face (face spec doc &rest args)
   "Like `defface', but FACE is evaluated as a normal argument."
   (unless (get face 'face-defface-spec)
-    (when (fboundp 'facep)
-      (unless (facep face)
-       ;; If the user has already created the face, respect that.
-       (let ((value (or (get face 'saved-face) spec))
-             (have-window-system (memq initial-window-system '(x w32))))
-         ;; Create global face.
-         (make-empty-face face)
-         ;; Create frame-local faces
-         (dolist (frame (frame-list))
-           (face-spec-set-2 face frame value)
-           (when (memq (window-system frame) '(x w32 ns))
-             (setq have-window-system t)))
-         ;; When making a face after frames already exist
-         (if have-window-system
-             (make-face-x-resource-internal face)))))
+    (unless (facep face)
+      ;; If the user has already created the face, respect that.
+      (let ((value (or (get face 'saved-face) spec))
+           (have-window-system (memq initial-window-system '(x w32))))
+       ;; Create global face.
+       (make-empty-face face)
+       ;; Create frame-local faces
+       (dolist (frame (frame-list))
+         (face-spec-set-2 face frame value)
+         (when (memq (window-system frame) '(x w32 ns))
+           (setq have-window-system t)))
+       ;; When making a face after frames already exist
+       (if have-window-system
+           (make-face-x-resource-internal face))))
     ;; Don't record SPEC until we see it causes no errors.
     (put face 'face-defface-spec (purecopy spec))
     (push (cons 'defface face) current-load-list)
     (when (and doc (null (face-documentation face)))
       (set-face-documentation face (purecopy doc)))
     (custom-handle-all-keywords face args 'custom-face)
-    (run-hooks 'custom-define-hook))
+    (run-hooks 'custom-define-hook)
+    ;; If the face has an existing theme setting, recalculate it.
+    (if (get face 'theme-face)
+       (custom-theme-recalc-face face)))
   face)
 
 ;;; Face attributes.
@@ -348,7 +350,7 @@ FACE's list property `theme-face' \(using `custom-push-theme')."
              (put face 'face-override-spec nil)
              (face-spec-set face spec t))))))))
 
-;; XEmacs compability function.  In XEmacs, when you reset a Custom
+;; XEmacs compatibility function.  In XEmacs, when you reset a Custom
 ;; Theme, you have to specify the theme to reset it to.  We just apply
 ;; the next theme.
 (defun custom-theme-reset-faces (theme &rest args)