Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Avoid making redundant pseudo-obsolete-face aliases via inheritance

This was causing color-theme-select to recurse infinitely when trying
to resolve the inheritance.

Fixes #13
  • Loading branch information...
commit a942799d6a9fe1ba367135b504a92c7c92ae1f84 1 parent 0fd6649
Dave Abrahams authored October 03, 2011

Showing 1 changed file with 12 additions and 7 deletions. Show diff stats Hide diff stats

  1. 19  zenburn.el
19  zenburn.el
@@ -26,6 +26,9 @@
26 26
 
27 27
 (require 'color-theme)
28 28
 
  29
+(require 'cus-edit)            ;; for custom-face-tag-face et. al
  30
+(require 'org-faces)           ;; for org faces in alias clause
  31
+
29 32
 (defvar zenburn-fg "#dcdccc")
30 33
 (defvar zenburn-bg-1 "#282828")
31 34
 (defvar zenburn-bg "#3f3f3f")
@@ -800,7 +803,7 @@
800 803
     ;;      Are these aliases still necessary?
801 804
     (zenburn-make-face-alias-clauses
802 805
      '(Buffer-menu-buffer-face
803  
-       apt-utils-broken-face
  806
+;       apt-utils-broken-face
804 807
        apt-utils-description-face
805 808
        apt-utils-field-contents-face
806 809
        apt-utils-field-keyword-face
@@ -980,8 +983,8 @@
980 983
        message-header-xheader-face
981 984
        message-mml-face
982 985
        message-separator-face
983  
-       mtorus-highlight-face
984  
-       mtorus-notify-highlight-face
  986
+;       mtorus-highlight-face
  987
+;       mtorus-notify-highlight-face
985 988
        nxml-attribute-colon-face
986 989
        nxml-attribute-local-name-face
987 990
        nxml-attribute-prefix-face
@@ -1144,10 +1147,12 @@ static char *gnus-pointer[] = {
1144 1147
             (error "Invalid face alias: %s" alias-name)
1145 1148
           (let ((target-name (replace-regexp-in-string
1146 1149
                               ".*\\(-face\\)" ""
1147  
-                              alias-name nil nil 1)))
1148  
-            (push `(,(intern alias-name)
1149  
-                    ((t (:inherit ,(intern target-name)))))
1150  
-                  clauses)))))))
  1150
+                              alias-name nil nil 1))
  1151
+                (alias (intern alias-name)))
  1152
+            (unless (get alias 'face-alias)
  1153
+              (push `(,alias
  1154
+                      ((t (:inherit ,(intern target-name)))))
  1155
+                    clauses))))))))
1151 1156
 
1152 1157
 (defalias 'zenburn #'color-theme-zenburn)
1153 1158
 

0 notes on commit a942799

Please sign in to comment.
Something went wrong with that request. Please try again.