unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: Re: "Invalid face reference" msg logged to *Messages* (but no error)
Date: Tue, 05 May 2009 23:26:34 -0400	[thread overview]
Message-ID: <jwvr5z2kjbb.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <000d01c9cdf2$8d7e1580$0200a8c0@us.oracle.com> (Drew Adams's message of "Tue, 5 May 2009 19:29:58 -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, 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).


        Stefan




  parent reply	other threads:[~2009-05-06  3:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-05 18:54 "Invalid face reference" msg logged to *Messages* (but no error) Drew Adams
2009-05-06  0:12 ` Drew Adams
2009-05-06  1:25   ` Stefan Monnier
2009-05-06  2:29     ` Drew Adams
2009-05-06  3:01       ` Miles Bader
2009-05-06  3:26       ` Stefan Monnier [this message]
2009-05-06  5:54         ` Drew Adams
2009-05-06 18:38       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvr5z2kjbb.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).