[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
internal-lisp-face-p is not very discriminating, is it?
From: |
Juanma Barranquero |
Subject: |
internal-lisp-face-p is not very discriminating, is it? |
Date: |
Tue, 29 May 2007 16:48:07 +0200 |
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);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- internal-lisp-face-p is not very discriminating, is it?,
Juanma Barranquero <=