comparison src/faces.c @ 2867:abbd4c295aa2

[xemacs-hg @ 2005-07-20 07:36:33 by didierv] Face aliases II (suggestions from sjt)
author didierv
date Wed, 20 Jul 2005 07:36:44 +0000
parents 8baa2f03d853
children 1e7cc382eb16
comparison
equal deleted inserted replaced
2866:a6eb79705def 2867:abbd4c295aa2
58 Lisp_Object Vpointer_face, Vvertical_divider_face, Vtoolbar_face, Vwidget_face; 58 Lisp_Object Vpointer_face, Vvertical_divider_face, Vtoolbar_face, Vwidget_face;
59 59
60 /* Qdefault, Qhighlight, Qleft_margin, Qright_margin defined in general.c */ 60 /* Qdefault, Qhighlight, Qleft_margin, Qright_margin defined in general.c */
61 Lisp_Object Qmodeline, Qgui_element, Qtext_cursor, Qvertical_divider; 61 Lisp_Object Qmodeline, Qgui_element, Qtext_cursor, Qvertical_divider;
62 62
63 Lisp_Object Qface_alias, Qcyclic_face_aliasing; 63 Lisp_Object Qface_alias, Qcyclic_face_alias;
64 64
65 /* In the old implementation Vface_list was a list of the face names, 65 /* In the old implementation Vface_list was a list of the face names,
66 not the faces themselves. We now distinguish between permanent and 66 not the faces themselves. We now distinguish between permanent and
67 temporary faces. Permanent faces are kept in a regular hash table, 67 temporary faces. Permanent faces are kept in a regular hash table,
68 temporary faces in a weak hash table. */ 68 temporary faces in a weak hash table. */
639 return face_or_name; 639 return face_or_name;
640 640
641 face_name = face_or_name; 641 face_name = face_or_name;
642 CHECK_SYMBOL (face_name); 642 CHECK_SYMBOL (face_name);
643 643
644 # define FACE_ALIASING_MAX_DEPTH 32 644 # define FACE_ALIAS_MAX_DEPTH 32
645 645
646 i = 0; 646 i = 0;
647 while (! NILP ((face_alias = Fget (face_name, Qface_alias, Qnil))) 647 while (! NILP ((face_alias = Fget (face_name, Qface_alias, Qnil)))
648 && i < FACE_ALIASING_MAX_DEPTH) 648 && i < FACE_ALIAS_MAX_DEPTH)
649 { 649 {
650 face_name = face_alias; 650 face_name = face_alias;
651 CHECK_SYMBOL (face_alias); 651 CHECK_SYMBOL (face_alias);
652 i += 1; 652 i += 1;
653 } 653 }
654 654
655 /* #### This test actually makes the aliasing max depth to 30, which is more 655 /* #### This test actually makes the aliasing max depth to 30, which is more
656 #### than enough IMO. -- dvl */ 656 #### than enough IMO. -- dvl */
657 if (i == FACE_ALIASING_MAX_DEPTH) 657 if (i == FACE_ALIAS_MAX_DEPTH)
658 signal_error (Qcyclic_face_aliasing, 658 signal_error (Qcyclic_face_alias,
659 "Max face aliasing depth reached", 659 "Max face aliasing depth reached",
660 face_name); 660 face_name);
661 661
662 # undef FACE_ALIASING_MAX_DEPTH 662 # undef FACE_ALIAS_MAX_DEPTH
663 663
664 /* Check if the name represents a permanent face. */ 664 /* Check if the name represents a permanent face. */
665 retval = Fgethash (face_name, Vpermanent_faces_cache, Qnil); 665 retval = Fgethash (face_name, Vpermanent_faces_cache, Qnil);
666 if (!NILP (retval)) 666 if (!NILP (retval))
667 return retval; 667 return retval;
1890 /* Qhighlight, Qreverse defined in general.c */ 1890 /* Qhighlight, Qreverse defined in general.c */
1891 DEFSYMBOL (Qdim); 1891 DEFSYMBOL (Qdim);
1892 DEFSYMBOL (Qblinking); 1892 DEFSYMBOL (Qblinking);
1893 1893
1894 DEFSYMBOL (Qface_alias); 1894 DEFSYMBOL (Qface_alias);
1895 DEFERROR_STANDARD (Qcyclic_face_aliasing, Qinvalid_state); 1895 DEFERROR_STANDARD (Qcyclic_face_alias, Qinvalid_state);
1896 1896
1897 DEFSYMBOL (Qinit_face_from_resources); 1897 DEFSYMBOL (Qinit_face_from_resources);
1898 DEFSYMBOL (Qinit_global_faces); 1898 DEFSYMBOL (Qinit_global_faces);
1899 DEFSYMBOL (Qinit_device_faces); 1899 DEFSYMBOL (Qinit_device_faces);
1900 DEFSYMBOL (Qinit_frame_faces); 1900 DEFSYMBOL (Qinit_frame_faces);