help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: how to track down "invalid face attribute" errors?


From: Emanuel Berg
Subject: Re: how to track down "invalid face attribute" errors?
Date: Sun, 25 Sep 2022 15:00:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eric S Fraga wrote:

> some package I'm using is leading to errors of the form
>
>   Invalid face attribute :foreground nil [54 times]
>
> can anybody suggest how I can track down which
> package/function is causing this? Debugging on error doesn't
> catch this. All web searches lead me to specific packages
> that have had this error in the past (none of which I use).

Sounds like that error message should be changed to include
what face causes trouble, if possible?

BTW here is a function to loop thru all faces and set them to
something, try for example

;; (set-all-faces "red")

Maybe you can modify that to retrieve attributes instead?

That could be cool ...

(defun set-all-faces (fg &optional bg weight)
  (let ((backg (or bg     "black"))
        (wght  (or weight 'normal))
        (faces) )
    (mapatoms (lambda (s)
                (when (facep s)
                  (push (symbol-name s) faces) )))
    (dolist (f faces)
      (set-face-attribute (intern f) nil
                          :foreground fg)
                          :background backg
                          :weight     wght
                          :italic     nil) ))

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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