all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* internal-lisp-face-p is not very discriminating, is it?
@ 2007-05-29 14:48 Juanma Barranquero
  2007-06-03 16:52 ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Juanma Barranquero @ 2007-05-29 14:48 UTC (permalink / raw)
  To: Emacs-Devel

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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-06-05 10:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-29 14:48 internal-lisp-face-p is not very discriminating, is it? Juanma Barranquero
2007-06-03 16:52 ` Richard Stallman
2007-06-05 10:28   ` Juanma Barranquero

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.