]> code.delx.au - gnu-emacs/blobdiff - lisp/cus-face.el
(url-http-mark-connection-as-free, url-http-find-free-connection):
[gnu-emacs] / lisp / cus-face.el
index 8a6e77f980503cbe271c2e23fd16e2a00ad11378..53ad08498f6c0aab23a2e6fdd354fb127103ad2c 100644 (file)
@@ -1,7 +1,7 @@
 ;;; cus-face.el --- customization support for faces
 ;;
 ;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;;   2005, 2006 Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: help, faces
@@ -320,13 +320,18 @@ FACE's list property `theme-face' \(using `custom-push-theme')."
            (let ((face (nth 0 entry))
                  (spec (nth 1 entry))
                  (now (nth 2 entry))
-                 (comment (nth 3 entry)))
+                 (comment (nth 3 entry))
+                 oldspec)
              ;; If FACE is actually an alias, customize the face it
              ;; is aliased to.
              (if (get face 'face-alias)
                  (setq face (get face 'face-alias)))
-             (put face 'saved-face spec)
-             (put face 'saved-face-comment comment)
+
+             (setq oldspec (get face 'theme-face))
+             (when (not (and oldspec (eq 'user (caar oldspec))))
+               (put face 'saved-face spec)
+               (put face 'saved-face-comment comment))
+
              (custom-push-theme 'theme-face face theme 'set spec)
              (when (or now immediate)
                (put face 'force-face (if now 'rogue 'immediate)))
@@ -345,17 +350,20 @@ FACE's list property `theme-face' \(using `custom-push-theme')."
          (custom-push-theme 'theme-face face theme 'set spec))
        (setq args (cdr (cdr args))))))))
 
+;; XEmacs compability 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.
 ;;;###autoload
 (defun custom-theme-reset-faces (theme &rest args)
   "Reset the specs in THEME of some faces to their specs in other themes.
 Each of the arguments ARGS has this form:
 
-    (FACE FROM-THEME)
+    (FACE IGNORED)
 
-This means reset FACE to its value in FROM-THEME."
+This means reset FACE.  The argument IGNORED is ignored."
   (custom-check-theme theme)
   (dolist (arg args)
-    (custom-push-theme 'theme-face (car arg) theme 'reset (cadr arg))))
+    (custom-push-theme 'theme-face (car arg) theme 'reset)))
 
 ;;;###autoload
 (defun custom-reset-faces (&rest args)