[Top][All Lists]

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

RE: "Invalid face reference" msg logged to *Messages* (but no error)

From: Drew Adams
Subject: RE: "Invalid face reference" msg logged to *Messages* (but no error)
Date: Tue, 5 May 2009 22:54:32 -0700

> > I had the same code in several places (different commands) actually,
> > from copy+pasting no doubt. What's odd it that it still worked. The
> > only difference I can see is the message logged to *Messages*. The
> > face was added properly, combined with other text 
> > properties properly
> > when that was the case, etc. I don't understand it, but that's
> > the case.
> The `face' property can hold a list of faces as well,

Right; I use that in this particular code, in fact, merging various faces.

> so your (quote some-face) was really saying "combine the face `some-face' 
> and the face `quote'". So the redisplay skipped the non-existent `quote' 
> face (with an appropriate error message) and used just `some-face'.

That's what I guessed (after this mail exchange); I figured it must just be
tolerant. From Miles's message I see that the reason is that redisplay can't
really do much else, reasonably.

> > I wonder too why such a thing is not handled as an error, or even as
> > a message to the echo area, but just logged in *Messages*.  
> > Is it the case perhaps that we never raise an error from the
> > redisplay code?
> The redisplay code is executed "asynchronously" and 
> signalling an error from it is rather problematic. Of course, the
> error could be caught earlier during the `add-text-properties' call,
> but currently add-text-properties knows nothing about the special
> meaning of `face' (or any other special text property for that
> matter),

Right; of course.

> so it would require a significant change (and risks introducing
> bugs since e.g. in your example you may actually define the
> `quote' face just after doing the add-text-properties).


IIUC, `add-text-property' actually does add the `face' property value `quote' -
there is no error at that level/time. It is only during redisplay that redisplay
mentions in passing that at that moment it doesn't recognize any face named
`quote'. That all sounds good, to me.

Thanks for the explanations.

reply via email to

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