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: Eli Zaretskii
Subject: Re: how to track down "invalid face attribute" errors?
Date: Wed, 05 Oct 2022 16:51:19 +0300

> From: Felix Dietrich <felix.dietrich@sperrhaken.name>
> Cc: help-gnu-emacs@gnu.org
> Date: Wed, 05 Oct 2022 14:32:04 +0200
> 
> But “xfaces.c:merge_face_ref” (which produces the error message) has a
> “struct window w” parameter.  I believe in cases where it is not NULL,
> which it isnʼt when running the above code, this could be used to derive
> the buffer and the bufferʼs position using the struct members “contents”
> and “pointm’:

Face merging has nothing to do with point, it just considers the face
attributes.  The commentary to merge_face_ref says how the window
pointer is used:

  /* Merge face attributes from the lisp `face reference' FACE_REF on
     frame F into the face attribute vector TO as appropriate for
     window W; W is used only for filtering face specs.
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you want to understand what that filtering is about, look at
filter_face_ref, where you will clearly see that it never accesses the
window's buffer or its point.

So when this function is called, there's no reason to believe that the
buffer position of point has anything to do with the offending face.
The most frequent face merging is performed by redisplay, which
doesn't move point and doesn't make the window on whose display it is
working the selected window.

> Anyway, perhaps, if there is any interest in adding information to the
> “Invalid face attribute” log message, further discussion should move to
> a wishlist bug report?

Definitely.  This discussion doesn't belong to the help list.



reply via email to

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