From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: "Invalid face reference" msg logged to *Messages* (but no error) Date: Tue, 05 May 2009 23:26:34 -0400 Message-ID: References: <002c01c9cdb2$ec215510$0200a8c0@us.oracle.com> <006d01c9cddf$622ae830$0200a8c0@us.oracle.com> <000d01c9cdf2$8d7e1580$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1241580454 15670 80.91.229.12 (6 May 2009 03:27:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 May 2009 03:27:34 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 06 05:27:24 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M1XmT-0004Jd-6Q for ged-emacs-devel@m.gmane.org; Wed, 06 May 2009 05:26:49 +0200 Original-Received: from localhost ([127.0.0.1]:57775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1XmS-00052R-G0 for ged-emacs-devel@m.gmane.org; Tue, 05 May 2009 23:26:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M1XmM-000522-VM for emacs-devel@gnu.org; Tue, 05 May 2009 23:26:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M1XmH-00051A-E1 for emacs-devel@gnu.org; Tue, 05 May 2009 23:26:41 -0400 Original-Received: from [199.232.76.173] (port=54504 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1XmH-000516-8B for emacs-devel@gnu.org; Tue, 05 May 2009 23:26:37 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:30313) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M1XmG-0003AT-VX for emacs-devel@gnu.org; Tue, 05 May 2009 23:26:37 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182] helo=ironport2-out.teksavvy.com) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M1XmG-0002Dh-Dw for emacs-devel@gnu.org; Tue, 05 May 2009 23:26:36 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUFALCfAErO+IYe/2dsb2JhbACBUM1ehAEFhU4 X-IronPort-AV: E=Sophos;i="4.40,301,1238990400"; d="scan'208";a="38051790" Original-Received: from 206-248-134-30.dsl.teksavvy.com (HELO ceviche.home) ([206.248.134.30]) by ironport2-out.teksavvy.com with ESMTP; 05 May 2009 23:26:34 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 83753B523F; Tue, 5 May 2009 23:26:34 -0400 (EDT) In-Reply-To: <000d01c9cdf2$8d7e1580$0200a8c0@us.oracle.com> (Drew Adams's message of "Tue, 5 May 2009 19:29:58 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux) X-Detected-Operating-System: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:110712 Archived-At: > 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