From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: "Invalid face reference" msg logged to *Messages* (but no error) Date: Tue, 5 May 2009 22:54:32 -0700 Message-ID: <001301c9ce0f$211b2c30$0200a8c0@us.oracle.com> 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" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1241589293 32502 80.91.229.12 (6 May 2009 05:54:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 May 2009 05:54:53 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Stefan Monnier'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 06 07:54:44 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 1M1a5b-0005WR-GV for ged-emacs-devel@m.gmane.org; Wed, 06 May 2009 07:54:43 +0200 Original-Received: from localhost ([127.0.0.1]:51329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1a5a-0004NU-Mo for ged-emacs-devel@m.gmane.org; Wed, 06 May 2009 01:54:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M1a5T-0004MB-MT for emacs-devel@gnu.org; Wed, 06 May 2009 01:54:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M1a5N-0004Ic-8c for emacs-devel@gnu.org; Wed, 06 May 2009 01:54:34 -0400 Original-Received: from [199.232.76.173] (port=58913 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1a5N-0004IV-3G for emacs-devel@gnu.org; Wed, 06 May 2009 01:54:29 -0400 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]:60212 helo=rgminet11.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M1a5M-0000Js-GK for emacs-devel@gnu.org; Wed, 06 May 2009 01:54:28 -0400 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n465sfJO020366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 6 May 2009 05:54:43 GMT Original-Received: from abhmt007.oracle.com (abhmt007.oracle.com [141.146.116.16]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n465shS3031811; Wed, 6 May 2009 05:54:44 GMT Original-Received: from dradamslap1 (/98.210.250.59) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 05 May 2009 22:54:23 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcnN+qkkUTRDf9WjTyesjHg865NhfQAEvrag X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: abhmt007.oracle.com [141.146.116.16] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.4A012610.02A0:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:110714 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, 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). Yes. 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.