changeset 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 a6eb79705def
children ca8762d71188
files CHANGES-beta ChangeLog man/ChangeLog man/lispref/faces.texi src/ChangeLog src/faces.c
diffstat 6 files changed, 29 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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  <didier@xemacs.org>
+
+	* CHANGES-beta: Remove the face aliasing feature announcement.
+
 2005-07-19  Didier Verna  <didier@xemacs.org>
 
 	* CHANGES-beta: Announce the face aliasing feature.
--- 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  <didier@xemacs.org>
+
+	* lispref/faces.texi (Basic Face Functions): Rephrase the face
+	aliasing paragraph following a suggestion from Stephen J.
+	Turnbull.
+
 2005-07-19  Didier Verna  <didier@xemacs.org>
 
 	* lispref/faces.texi (Basic Face Functions): Document the face
--- 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.
 
 
 
--- 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  <didier@xemacs.org>
+
+	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  <didier@xemacs.org>
 
 	* faces.c (Ffind_face): Implement face aliasing.
--- 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);