emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104625: Fix for disable-theme/deffac


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104625: Fix for disable-theme/defface interaction (Bug#8889).
Date: Sat, 18 Jun 2011 14:49:19 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104625
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2011-06-18 14:49:19 -0400
message:
  Fix for disable-theme/defface interaction (Bug#8889).
  
  * lisp/cus-face.el (custom-declare-face): Call custom-theme-recalc face
  anytime existing face settings are present.
modified:
  lisp/ChangeLog
  lisp/cus-face.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-06-18 16:23:11 +0000
+++ b/lisp/ChangeLog    2011-06-18 18:49:19 +0000
@@ -1,5 +1,8 @@
 2011-06-18  Chong Yidong  <address@hidden>
 
+       * cus-face.el (custom-declare-face): Call custom-theme-recalc face
+       anytime existing face settings are present (Bug#8889).
+
        * progmodes/delphi.el (delphi-mode-syntax-table): Use defvar.
        (delphi-mode): Use define-derived-mode to inherit from prog-mode.
        Remove unused argument.

=== modified file 'lisp/cus-face.el'
--- a/lisp/cus-face.el  2011-05-08 20:07:38 +0000
+++ b/lisp/cus-face.el  2011-06-18 18:49:19 +0000
@@ -34,30 +34,33 @@
 (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)
-    (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)
-    ;; If the face has an existing theme setting, recalculate it.
-    (if (get face 'theme-face)
-       (custom-theme-recalc-face face)))
+    (let ((facep (facep face)))
+      (unless facep
+       ;; 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)
+      ;; If the face had existing settings, recalculate it.  For
+      ;; example, the user might load a theme with a face setting, and
+      ;; later load a library defining that face.
+      (if facep
+         (custom-theme-recalc-face face))))
   face)
 
 ;;; Face attributes.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]