Uwe Brauer writes:
 (1) (local-variables/warning) Error in File local-variables: Wrong
type argument: consp, latin-iso8859-2
 
 Backtrace follows:
 
   specifier-matching-instance 
Oh, yeah, you can thank Aidan Kehoe for this one.
Apply this patch (untested, that's why I haven't submitted it yet),
rebuild XEmacs, and test.
diff -r 9624523604c5 lisp/ChangeLog
--- a/lisp/ChangeLog	Fri Feb 19 23:46:53 2010 +0000
+++ b/lisp/ChangeLog	Sun Feb 21 00:03:58 2010 +0900
@@ -0,0 +1,5 @@
+2010-02-20  Stephen J. Turnbull  <stephen(a)xemacs.org>
+
+	* faces.el (face-property-matching-instance):
+	Document behavior of MATCHSPEC as upward compatible from 21.4.
+
diff -r 9624523604c5 src/ChangeLog
--- a/src/ChangeLog	Fri Feb 19 23:46:53 2010 +0000
+++ b/src/ChangeLog	Sun Feb 21 00:03:58 2010 +0900
@@ -0,0 +1,16 @@
+2010-02-20  Stephen J. Turnbull  <stephen(a)xemacs.org>
+
+	* specifier.c (maybe_charset_to_matchspec):
+	New function for 21.4 compatibility.
+	(Fspecifier_matching_instance):
+	Use it and document new behavior for all four functions.
+	(Fspecifier_matching_instantiator):
+	(Fspecifier_matching_instance_from_inst_list):
+	(Fspecifier_matching_instantiator_from_inst_list):
+	Use it.
+
+	* fontcolor.c (font_validate_matchspec):
+	De-obfuscate.
+	(font_instantiate):
+	Update preceding block comment, and fix a typo in it.
+
diff -r 9624523604c5 lisp/faces.el
--- a/lisp/faces.el	Fri Feb 19 23:46:53 2010 +0000
+++ b/lisp/faces.el	Sun Feb 21 00:03:58 2010 +0900
@@ -239,14 +239,18 @@
 					&optional domain default
 					no-fallback)
   "Return the instance of FACE's PROPERTY matching MATCHSPEC in DOMAIN.
-Currently the only useful value for MATCHSPEC is a charset, when used
-in conjunction with the face's font; this allows you to retrieve a
-font that can be used to display a particular charset, rather than just
-any font.
 
-Other than MATCHSPEC, this function is identical to `face-property-instance'.
-See also `specifier-matching-instance' for a fuller description of the
-matching process."
+See `face-property-instance' for details of the instancing process, and
+the semantics of FACE, PROPERTY, and DOMAIN.
+
+Currently MATCHSPEC is only useful with the 'font property.  In this case
+MATCHSPEC may be a cons \(CHARSET . STAGE) of a charset (or a symbol
+representing a charset) and a stage symbol, either 'initial or 'final.
+This allows retrieval of a font that can be used to display a particular
+charset, rather than just any font.  For backward compatibility with 21.4,
+MATCHSPEC may also be a charset or charset symbol.
+
+See `specifier-matching-instance' for details of MATCHSPEC processing."
 
   (setq face (get-face face))
   (let ((value (get face property)))
diff -r 9624523604c5 src/fontcolor.c
--- a/src/fontcolor.c	Fri Feb 19 23:46:53 2010 +0000
+++ b/src/fontcolor.c	Sun Feb 21 00:03:58 2010 +0900
@@ -799,20 +799,13 @@
   CHECK_CONS (matchspec);
   Fget_charset (XCAR (matchspec));
 
-  do
-    {
-      if (EQ(XCDR(matchspec), Qinitial))
-	{
-	  break;
-	}
-      if (EQ(XCDR(matchspec), Qfinal))
-	{
-	  break;
-	}
+  {
+    Lisp_Object stage = XCDR(matchspec);
+    if (EQ(stage, Qinitial) || (EQ(stage, Qfinal)))
+      return;
 
-      invalid_argument("Invalid font matchspec stage",
-		       XCDR(matchspec));
-    } while (0);
+    invalid_argument("Invalid stage in font matchspec", stage);
+  }
 }
 
 void
@@ -852,9 +845,11 @@
    in additional information needed to instantiate some object.  For fonts,
    it's a cons of (CHARSET . SECOND-STAGE-P).  SECOND-STAGE-P, if set,
    means "try harder to find an appropriate font" and is a very bogus way
-   of dealing with the fact that it may not be possible to may a charset
-   directly onto a font; it's used esp. under Windows.  @@#### We need to
-   change this so that MATCHSPEC is just a character.
+   of dealing with the fact that it may not be possible to map a charset
+   directly onto a font; it's used esp. under Windows.  (It will also help
+   improve font choice on platforms with fontconfig and on the Mac.)
+   @@#### We need to change this so that MATCHSPEC is just a character (or
+   a charset, for compatibility with 21.4).
 
    When redisplay is building up its structure, and needs font info, it
    calls functions in faces.c such as ensure_face_cachel_complete() (map
diff -r 9624523604c5 src/specifier.c
--- a/src/specifier.c	Fri Feb 19 23:46:53 2010 +0000
+++ b/src/specifier.c	Sun Feb 21 00:03:58 2010 +0900
@@ -3190,6 +3190,13 @@
 				 no_fallback, 1);
 }
 
+/* Allows code written for 21.4 to continue to work. */
+static Lisp_Object
+maybe_charset_to_matchspec (Lisp_Object spec)
+{
+  return CHARSETP (spec) ? Fcons (spec, Qinitial) : spec;
+}
+
 DEFUN ("specifier-matching-instance", Fspecifier_matching_instance, 2, 5, 0,
/*
 Return an instance for SPECIFIER in DOMAIN that matches MATCHSPEC.
 If no instance can be generated for this domain, return DEFAULT.
@@ -3207,7 +3214,7 @@
    display table is not there. (Chartable specifiers are not yet
    implemented.)
 
--- For font specifiers, MATCHSPEC should be a cons (CHARSET . STAGE).
+-- For font specifiers, MATCHSPEC should be a cons \(CHARSET . STAGE).
    The defined stages are currently `initial' and `final'.  On X11, 'initial
    is used when the font matching process is looking for fonts that match
    the desired registries of the charset--see the `charset-registries'
@@ -3218,6 +3225,9 @@
    registry and encoding used will be `iso10646-1', and the characters will
    be converted to display using that registry.
 
+   For backward compatibility with Lisp code written for 21.4, a bare
+   charset CHARSET is accepted and interpreted as \(CHARSET . initial).
+
    See `define-specifier-tag' for details on how to create a tag that
    specifies a given character set and stage combination.  You can supply
    such a tag to `set-face-font' in order to set a face's font for that
@@ -3225,6 +3235,7 @@
 */
        (specifier, matchspec, domain, default_, no_fallback))
 {
+  matchspec = maybe_charset_to_matchspec (matchspec);
   return specifier_matching_foo (specifier, matchspec, domain, default_,
 				 no_fallback, 0);
 }
@@ -3240,6 +3251,7 @@
 */
        (specifier, matchspec, domain, default_, no_fallback))
 {
+  matchspec = maybe_charset_to_matchspec (matchspec);
   return specifier_matching_foo (specifier, matchspec, domain, default_,
 				 no_fallback, 1);
 }
@@ -3320,6 +3332,7 @@
 */
        (specifier, matchspec, domain, inst_list, default_))
 {
+  matchspec = maybe_charset_to_matchspec (matchspec);
   return specifier_matching_foo_from_inst_list (specifier, matchspec,
 						domain, inst_list, default_,
 						0);
@@ -3335,6 +3348,7 @@
 */
        (specifier, matchspec, domain, inst_list, default_))
 {
+  matchspec = maybe_charset_to_matchspec (matchspec);
   return specifier_matching_foo_from_inst_list (specifier, matchspec,
 						domain, inst_list, default_,
 						1);
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta