# HG changeset patch # User didierv # Date 1121845004 0 # Node ID abbd4c295aa22cd5928e824263293c8f644f9325 # Parent a6eb79705def484ea61ef52af1f444d71074e25f [xemacs-hg @ 2005-07-20 07:36:33 by didierv] Face aliases II (suggestions from sjt) diff -r a6eb79705def -r abbd4c295aa2 CHANGES-beta --- a/CHANGES-beta Tue Jul 19 21:51:19 2005 +0000 +++ b/CHANGES-beta Wed Jul 20 07:36:44 2005 +0000 @@ -1,10 +1,3 @@ -to 21.5.22 "???" - -User-Visible Bug Fixes and Minor Improvements - --- Improve: Face aliasing from NAME1 to NAME2 by means of - (put 'NAME1 'face-alias 'NAME2). (Didier Verna) - to 21.5.21 "corn" Major features diff -r a6eb79705def -r abbd4c295aa2 ChangeLog --- a/ChangeLog Tue Jul 19 21:51:19 2005 +0000 +++ b/ChangeLog Wed Jul 20 07:36:44 2005 +0000 @@ -1,3 +1,7 @@ +2005-07-20 Didier Verna + + * CHANGES-beta: Remove the face aliasing feature announcement. + 2005-07-19 Didier Verna * CHANGES-beta: Announce the face aliasing feature. diff -r a6eb79705def -r abbd4c295aa2 man/ChangeLog --- a/man/ChangeLog Tue Jul 19 21:51:19 2005 +0000 +++ b/man/ChangeLog Wed Jul 20 07:36:44 2005 +0000 @@ -1,3 +1,9 @@ +2005-07-20 Didier Verna + + * lispref/faces.texi (Basic Face Functions): Rephrase the face + aliasing paragraph following a suggestion from Stephen J. + Turnbull. + 2005-07-19 Didier Verna * lispref/faces.texi (Basic Face Functions): Document the face diff -r a6eb79705def -r abbd4c295aa2 man/lispref/faces.texi --- a/man/lispref/faces.texi Tue Jul 19 21:51:19 2005 +0000 +++ b/man/lispref/faces.texi Wed Jul 20 07:36:44 2005 +0000 @@ -146,9 +146,9 @@ means of aliases. One typical use of this feature is to change the name of a face while preserving backward compatibility. If a symbol has the @code{face-alias} property set to another symbol, then this other symbol -will be used as the real face name instead (this is actually a recursive -process). There is currently a limit of 32 consecutive face aliases, in -order to prevent aliasing loops. +will be used as the real face name instead. Recursive aliases (aliases +of aliases) are allowed, but the depth of indirection is limited to 32 +to prevent alias loops. diff -r a6eb79705def -r abbd4c295aa2 src/ChangeLog --- a/src/ChangeLog Tue Jul 19 21:51:19 2005 +0000 +++ b/src/ChangeLog Wed Jul 20 07:36:44 2005 +0000 @@ -1,3 +1,12 @@ +2005-07-20 Didier Verna + + Following suggestions from Stephen J. Turnbull: + * faces.c (Qcyclic_face_alias): New name for + Qcyclic_face_aliasing. + * faces.c (Ffind_face): Use it. Rename FACE_ALIASING_MAX_DEPTH to + FACE_ALIAS_MAX_DEPTH. + * faces.c (syms_of_faces): Ditto. + 2005-07-19 Didier Verna * faces.c (Ffind_face): Implement face aliasing. diff -r a6eb79705def -r abbd4c295aa2 src/faces.c --- a/src/faces.c Tue Jul 19 21:51:19 2005 +0000 +++ b/src/faces.c Wed Jul 20 07:36:44 2005 +0000 @@ -60,7 +60,7 @@ /* Qdefault, Qhighlight, Qleft_margin, Qright_margin defined in general.c */ Lisp_Object Qmodeline, Qgui_element, Qtext_cursor, Qvertical_divider; -Lisp_Object Qface_alias, Qcyclic_face_aliasing; +Lisp_Object Qface_alias, Qcyclic_face_alias; /* In the old implementation Vface_list was a list of the face names, not the faces themselves. We now distinguish between permanent and @@ -641,11 +641,11 @@ face_name = face_or_name; CHECK_SYMBOL (face_name); -# define FACE_ALIASING_MAX_DEPTH 32 +# define FACE_ALIAS_MAX_DEPTH 32 i = 0; while (! NILP ((face_alias = Fget (face_name, Qface_alias, Qnil))) - && i < FACE_ALIASING_MAX_DEPTH) + && i < FACE_ALIAS_MAX_DEPTH) { face_name = face_alias; CHECK_SYMBOL (face_alias); @@ -654,12 +654,12 @@ /* #### This test actually makes the aliasing max depth to 30, which is more #### than enough IMO. -- dvl */ - if (i == FACE_ALIASING_MAX_DEPTH) - signal_error (Qcyclic_face_aliasing, + if (i == FACE_ALIAS_MAX_DEPTH) + signal_error (Qcyclic_face_alias, "Max face aliasing depth reached", face_name); -# undef FACE_ALIASING_MAX_DEPTH +# undef FACE_ALIAS_MAX_DEPTH /* Check if the name represents a permanent face. */ retval = Fgethash (face_name, Vpermanent_faces_cache, Qnil); @@ -1892,7 +1892,7 @@ DEFSYMBOL (Qblinking); DEFSYMBOL (Qface_alias); - DEFERROR_STANDARD (Qcyclic_face_aliasing, Qinvalid_state); + DEFERROR_STANDARD (Qcyclic_face_alias, Qinvalid_state); DEFSYMBOL (Qinit_face_from_resources); DEFSYMBOL (Qinit_global_faces);