[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: Stefan Monnier
Subject: Re: "Invalid face reference" msg logged to *Messages* (but no error)
Date: Tue, 05 May 2009 23:26:34 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux)

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

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


reply via email to

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