Ben Wing <ben(a)666.com> writes:
When I wrote all this code, I made a conscious decision, for
compatibility
reasons, to allow integers wherever characters are allowed. If we're going to
change this, (a) we should think carefully about what this means, and (b) we
should fix this all throughout XEmacs.
I am confused. Your plan and Kyles' plan below can't
coexist.
The bug you're seeing looks to actually be a bug in CHAR_INTP(),
which is
supposed to recognize valid character integers. Therefore, you should fix
this macro.
It's easy to fix and here is the patch. I'll send this to
xemacs-patches if this is needed after discussions are over.
Index: mule-charset.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/mule-charset.c,v
retrieving revision 1.12.2.20
diff -u -r1.12.2.20 mule-charset.c
--- mule-charset.c 1999/10/26 05:48:52 1.12.2.20
+++ mule-charset.c 1999/11/09 08:03:45
@@ -267,7 +267,8 @@
if (f3 < 0x20)
return 0;
- if (f3 != 0x20 && f3 != 0x7F)
+ if (f3 != 0x20 && f3 != 0x7F && !(f2 > MIN_CHAR_FIELD2_PRIVATE
&&
+ f2 < MAX_CHAR_FIELD2_PRIVATE))
return 1;
/*
@@ -276,6 +277,8 @@
FIELD2_TO_PRIVATE_LEADING_BYTE are the same.
*/
charset = CHARSET_BY_LEADING_BYTE (f2 + FIELD2_TO_OFFICIAL_LEADING_BYTE);
+ if (EQ (charset, Qnil))
+ return 0;
return (XCHARSET_CHARS (charset) == 96);
}
else
@@ -300,7 +303,8 @@
}
#endif /* ENABLE_COMPOSITE_CHARS */
- if (f2 != 0x20 && f2 != 0x7F && f3 != 0x20 && f3 != 0x7F)
+ if (f2 != 0x20 && f2 != 0x7F && f3 != 0x20 && f3 != 0x7F
+ && !(f1 > MIN_CHAR_FIELD1_PRIVATE && f1 <
MAX_CHAR_FIELD1_PRIVATE))
return 1;
if (f1 <= MAX_CHAR_FIELD1_OFFICIAL)
@@ -310,6 +314,8 @@
charset =
CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_PRIVATE_LEADING_BYTE);
+ if (EQ (charset, Qnil))
+ return 0;
return (XCHARSET_CHARS (charset) == 96);
}
}
Kyle Jones <kyle_jones(a)wonderworks.com> writes:
So far on xemacs-beta the current plan is to make Finsert (and
presumably any other buffer insertion function that accepts
chars) signal wrong-type-argument when presented with an integer.
I'm for this idea but as Ben pointed out, it will be a hard
work. Any suggestions?
As for the ?\ooo read syntax, \ooo should be allowed for \000-\377.
It should fail with some kind of read syntax error for anything
over 0377. This keep compatbility with 8-bit XEmacs, and doens't
break the abstraction layer for whatever the wide char turns out
to be.
I agree with this.
--
Yoshiki Hayashi