From 7c86531c8d8a17c53258a7c454a0efe90fa6f4e9 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 3 Oct 2011 14:46:11 -0400 Subject: [PATCH] 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 --- zenburn.el | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/zenburn.el b/zenburn.el index 9dec3d1..4fb2d37 100644 --- a/zenburn.el +++ b/zenburn.el @@ -26,6 +26,9 @@ (require 'color-theme) +(require 'cus-edit) ;; for custom-face-tag-face et. al +(require 'org-faces) ;; for org faces in alias clause + (defvar zenburn-fg "#dcdccc") (defvar zenburn-bg-1 "#282828") (defvar zenburn-bg "#3f3f3f") @@ -797,7 +800,7 @@ ;; Are these aliases still necessary? (zenburn-make-face-alias-clauses '(Buffer-menu-buffer-face - apt-utils-broken-face +; apt-utils-broken-face apt-utils-description-face apt-utils-field-contents-face apt-utils-field-keyword-face @@ -977,8 +980,8 @@ message-header-xheader-face message-mml-face message-separator-face - mtorus-highlight-face - mtorus-notify-highlight-face +; mtorus-highlight-face +; mtorus-notify-highlight-face nxml-attribute-colon-face nxml-attribute-local-name-face nxml-attribute-prefix-face @@ -1141,10 +1144,12 @@ static char *gnus-pointer[] = { (error "Invalid face alias: %s" alias-name) (let ((target-name (replace-regexp-in-string ".*\\(-face\\)" "" - alias-name nil nil 1))) - (push `(,(intern alias-name) - ((t (:inherit ,(intern target-name))))) - clauses))))))) + alias-name nil nil 1)) + (alias (intern alias-name))) + (unless (get alias 'face-alias) + (push `(,alias + ((t (:inherit ,(intern target-name))))) + clauses)))))))) (defalias 'zenburn #'color-theme-zenburn)