[COMMIT] Provide a FORCE argument in set-charset-registries

Aidan Kehoe kehoea at parhasard.net
Wed Nov 29 15:03:34 EST 2006


 Ar an tríú lá is fiche de mí na Samhain, scríobh Ilya N. Golubev: 

 > > [...] If I’m implementing something, it is relevant to me what
 > > real-world situations are affected by it.
 > 
 > Not necessarily. 

I disagree, but I value your input. This commit allows the behaviour you
describe; use

(set-charset-registries 
 'ascii 
 (apply 'vector "" (append (charset-registries 'ascii) nil))
 t)

in your init file to enable it. 

APPROVE COMMIT 

NOTE: This patch has been committed.

SUPERSEDES 17772.15412.189741.234207 at parhasard.net 

man/ChangeLog addition:

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

	* xemacs/custom.texi (Face Resources):
	Mention that the user should use full XLFD forms for specifying
	fonts, and that Mule builds reject the short forms by
	default. Also mention the work-around to the latter design choice
	that was implemented for Ilya. 


src/ChangeLog addition:

2006-11-29  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 -Nu
Files affected: src/mule-charset.c
===================================================================
RCS man/xemacs/custom.texi
===================================================================
RCS

Index: man/xemacs/custom.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/xemacs/custom.texi,v
retrieving revision 1.23
diff -u -u -r1.23 custom.texi
--- man/xemacs/custom.texi	2006/07/16 10:51:48	1.23
+++ man/xemacs/custom.texi	2006/11/29 19:47:03
@@ -3035,6 +3035,10 @@
 @end example
 @noindent
 
+All X fonts can be referred to via XLFD-style names, and you should use
+those forms.  See the man pages for @samp{X(1)}, @samp{xlsfonts(1)}, and
+ at samp{xfontsel(1)}.
+
 If you use any of the other, less strict font name formats, some of which
 look like
 
@@ -3045,9 +3049,14 @@
 @end example
 
 then XEmacs won't be able to guess the names of the bold and italic
-versions.  All X fonts can be referred to via XLFD-style names, so you
-should use those forms.  See the man pages for @samp{X(1)},
- at samp{xlsfonts(1)}, and @samp{xfontsel(1)}.
+versions, and on a build with internationalization support, it will
+refuse to use them.  (Since only the XLFD form includes information as
+to which character set the font coverage.)
+
+If it is very important to you to use the short form names, you can
+override this for ASCII, and for ASCII alone, by passing the
+ at samp{FORCE} argument to @samp{set-charset-registries}, and specifying
+an empty string as one of the charset registries. 
 
 @node Widgets
 @subsection Widgets
Index: src/mule-charset.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/mule-charset.c,v
retrieving revision 1.52
diff -u -u -r1.52 mule-charset.c
--- src/mule-charset.c	2006/11/15 21:40:02	1.52
+++ src/mule-charset.c	2006/11/29 19:47:04
@@ -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