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: Felix Dietrich
Subject: Re: how to track down "invalid face attribute" errors?
Date: Sun, 25 Sep 2022 16:26:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Hi Eric,

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> 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.

I am just going to brainstorm some ideas here:

1. Go through every buffer and check for every buffer position whether
any anonymous face set in a text property or overlay property has a
:foreground attribute that is nil.  This might give you an idea about
which packages could be responsible.  I do not have code for that, but
could probably concoct something.


2. Grep through your configuration and your installed packages for
":foreground" and see if it is paired with nil somewhere.  One of the
various functions to add text properties [1] or ‘overlay-put’ should be
close by.


3. Deactivate groups of packages and see what happens.  Might be a bit
to tedious and error prone if you have a lot installed and need to
manage their shared dependencies.


4. A bit of a harebrained sledgehammer approach (which might lead
nowhere): run Emacs in a debugger, set a watchpoint on ‘add_to_log’
being called with a ‘format’ argument starting with "Invalid face
attribute", then, on break, analyse the stack, and see if you can figure
out the culprit.


Footnotes:
[1]  (info "(elisp) Changing Properties")

     
<https://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Properties.html>

-- 
Felix Dietrich




reply via email to

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