emacs-devel
[Top][All Lists]
Advanced

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

`enable-theme' causing "Invalid face" error


From: martin rudalics
Subject: `enable-theme' causing "Invalid face" error
Date: Thu, 24 Nov 2005 11:06:15 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Suppose my .emacs contains just the following

(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(widget-button ((t (:inherit button)))))

If I now M-x load-theme RET foo, `enable-theme' will issue as last
action `(enable-theme 'user)'.  The latter will eventually call
`custom-theme-recalc-face' for widget-button which will as last
consequence trigger an "Invalid face" widget-button error during
`internal-set-lisp-face-attribute' (in `lface_from_face_name').


It may seem possible to fix this with

(defun custom-theme-recalc-face (face)
  "Set FACE according to currently enabled custom themes."
  (let ((theme-faces (reverse (get face 'theme-face))))
    (dolist (spec theme-faces)
      (unless (facep face)
        (make-empty-face face))
      (face-spec-set face (car (cddr spec))))))

but I'm completely unaware of any side-effects.


Please consider also removing

"See `custom-theme-set-faces' for more information on the interplay
between themes and faces."

from the doc-string of `custom-theme-set-faces'.





reply via email to

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