From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.devel Subject: internal-lisp-face-p is not very discriminating, is it? Date: Tue, 29 May 2007 16:48:07 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1180450098 13064 80.91.229.12 (29 May 2007 14:48:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 29 May 2007 14:48:18 +0000 (UTC) To: Emacs-Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 29 16:48:17 2007 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 1Ht2zh-00027Z-0W for ged-emacs-devel@m.gmane.org; Tue, 29 May 2007 16:48:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ht2zg-0005xb-J8 for ged-emacs-devel@m.gmane.org; Tue, 29 May 2007 10:48:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ht2zd-0005xW-36 for emacs-devel@gnu.org; Tue, 29 May 2007 10:48:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ht2zZ-0005xK-Md for emacs-devel@gnu.org; Tue, 29 May 2007 10:48:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ht2zZ-0005xH-Hn for emacs-devel@gnu.org; Tue, 29 May 2007 10:48:09 -0400 Original-Received: from wx-out-0506.google.com ([66.249.82.224]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ht2zZ-00066X-25 for emacs-devel@gnu.org; Tue, 29 May 2007 10:48:09 -0400 Original-Received: by wx-out-0506.google.com with SMTP id h26so1615495wxd for ; Tue, 29 May 2007 07:48:08 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=aEnybHWFTS0T+4Z1ytyS6+W2RUOJA4MbTmbBu+5CWgjUTaprRkhJ8lCQQ39Y32FCzPMFgiACD6GqTJ628xwS6tIxjcRvRQ46AD82GZt4jFVJXeR8yfPKC0lR7lx9BR9UYeKTAVAZe7Qj+qUl6NGn+p3cfUbnwEmi6LUtsJvPla8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=ZUDfN3iM8Pp7NQiDcEPKmLbdKtvMdsHNhlylcufeZh+Mqt10HSejiTjU2YazBu/+iYbOwKB8r3EBKLeacjl9tnOwSbv/nIjJC85lhMfgjCcnwGwnGJLJ5C3ZdV0WyVgoyizPyoKcl/yiXAovO9albc0impStSvb0IsPj1Eta/tE= Original-Received: by 10.90.70.10 with SMTP id s10mr4741147aga.1180450087988; Tue, 29 May 2007 07:48:07 -0700 (PDT) Original-Received: by 10.90.103.8 with HTTP; Tue, 29 May 2007 07:48:07 -0700 (PDT) Content-Disposition: inline X-detected-kernel: Linux 2.4-2.6 (Google crawlbot) 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:71947 Archived-At: ELISP> (facep 'my-face) nil ELISP> (put 'my-face 'face-alias 'my-face) my-face ELISP> (facep 'my-face) [face unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified] I would've expected the same behavior that `internal-lisp-face-empty-p': ELISP> (internal-lisp-face-empty-p 'my-face) *** Eval error *** List contains a loop: my-face Now, I've taken a look at xfaces.c and I understand why it is happening: internal_lisp_face_p calls lframe_from_face_name passing a 0 for the signal_p argument, so it returns a default face instead of signaling an error. Still, it seems very wrong that just "face-alias"ing a symbol to itself suddenly turns it into a (fake) face. It is not possible to modify internal_lisp_face_p to pass signal_p = 1 to lframe_from_face_name, because then dumping fails when loading face.el. However, the attached minimal patch seems to work. Does anyone see anything wrong with this change? Juanma Index: src/xfaces.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/xfaces.c,v retrieving revision 1.360 diff -u -r1.360 xfaces.c --- src/xfaces.c 26 May 2007 17:21:13 -0000 1.360 +++ src/xfaces.c 29 May 2007 14:34:37 -0000 @@ -3935,6 +3935,8 @@ { Lisp_Object lface; + face = resolve_face_name (face, 1); + if (!NILP (frame)) { CHECK_LIVE_FRAME (frame);