[PATCH] Add an argument FORCE to set-charset-registries.

Aidan Kehoe kehoea at parhasard.net
Tue Nov 28 08:40:04 EST 2006


I think this is fucking horrible, but I value Ilya’s input as a user, and
it’s not a ridiculously complicated change. 

src/ChangeLog addition:

2006-11-28  Aidan Kehoe  <kehoea at parhasard.net>

	* mule-charset.c (Fset_charset_registries):
	Add an optional argument FORCE, to allow specifying badly-formed
	CHARSET_REGISTRY-CHARSET_ENCODING combinations. Re-enables the
	sort of hacks described in 96wt67fa3f.fsf at mo.msk.ru from Ilya
	Golubev. 


XEmacs Trunk source patch:
Diff command:   cvs -q diff -u
Files affected: src/mule-charset.c
===================================================================
RCS

Index: src/mule-charset.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/mule-charset.c,v
retrieving revision 1.52
diff -u -r1.52 mule-charset.c
--- src/mule-charset.c	2006/11/15 21:40:02	1.52
+++ src/mule-charset.c	2006/11/28 13:31:11
@@ -891,7 +891,7 @@
   face_property_was_changed (Vdefault_face, Qfont, Qglobal);
 }
 
-DEFUN ("set-charset-registries", Fset_charset_registries, 2, 2, 0, /*
+DEFUN ("set-charset-registries", Fset_charset_registries, 2, 3, 0, /*
 Set the `registries' property of CHARSET to REGISTRIES.
 
 REGISTRIES is an ordered vector of strings that describe the X11
@@ -906,8 +906,22 @@
 
 (set-charset-registries 'ascii ["jisx0201.1976-0"])
 
+If optional argument FORCE is non-nil, avoid sanity-checking the elements of
+REGISTRIES. Normally the strings are checked to make sure they contain no
+XLFD wild cards and that they contain at least one hyphen; the only context
+in which one might want not to do this is in order to use a font which
+doesn't have a full XLFD--and thus, an effective
+CHARSET_REGISTRY-CHARSET_ENCODING of ""--to display ASCII.
+
+We recommend strongly that you specify a full XLFD, since this makes
+multilingual and variant font handling work much better. To get the full
+XLFD of any font, start xfd with the short name as the pattern argument:
+
+    xfd -fn 8x16kana
+
+and use the text that appears at the top of the window. 
 */
-       (charset, registries))
+       (charset, registries, force))
 {
   int i; 
   charset = Fget_charset (charset);
@@ -916,6 +930,12 @@
   for (i = 0; i < XVECTOR_LENGTH(registries); ++i)
     {
       CHECK_STRING (XVECTOR_DATA(registries)[i]);
+
+      if (!NILP(force))
+        {
+          continue;
+        }
+
       if (NULL == qxestrchr(XSTRING_DATA(XVECTOR_DATA(registries)[i]), '-'))
 	{
 	  invalid_argument("Not an X11 REGISTRY-ENCODING combination", 

-- 
Santa Maradona, priez pour moi!



More information about the XEmacs-Patches mailing list