GNU interpret "\xabcd" as containing one character, we interpret it as
containing three. GNU interpret '(?\xffff) as a list containing a single
integer (specified with character syntax), we interpret it as a list
containing a character and a symbol with the string "ff" as its name. Our
behaviour is more sane, since integer to character mappings above #xFF are
not stable or particularly well-defined, neither in GNU Emacs nor
XEmacs. Code written for the old behaviour is probably wrong, and is easily
rewritten.
In really old code, people would use ?\xffff instead of #xffff because GNU
didn’t support hexadecimal integer read syntax. This isn’t an issue any
more, the versions of GNU Emacs that don’t support #xFFFF are long
obsolete.
I’m about to post a patch detailing the packages changes necessary to
support this change in the trunk.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1216240563 -7200
# Node ID 7869173584fcd40b83462f6acad1a9e7d8be3da1
# Parent ec442dc06fe1bc671fbe0ed0a928b294cdd45aba
Error on over-long hex character escapes.
2008-07-16 Aidan Kehoe <kehoea(a)parhasard.net>
* lread.c (read_escape):
Error if we're handed an over-long hex character escape, something
which arises reasonably frequently in code written for GNU.
diff -r ec442dc06fe1 -r 7869173584fc src/ChangeLog
--- a/src/ChangeLog Thu Jul 10 23:37:52 2008 +0200
+++ b/src/ChangeLog Wed Jul 16 22:36:03 2008 +0200
@@ -1,3 +1,9 @@
+2008-07-16 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * lread.c (read_escape):
+ Error if we're handed an over-long hex character escape, something
+ which arises reasonably frequently in code written for GNU.
+
2008-07-07 Aidan Kehoe <kehoea(a)parhasard.net>
Patch to make it up to the device-specific code whether
diff -r ec442dc06fe1 -r 7869173584fc src/lread.c
--- a/src/lread.c Thu Jul 10 23:37:52 2008 +0200
+++ b/src/lread.c Wed Jul 16 22:36:03 2008 +0200
@@ -1855,6 +1855,28 @@
break;
}
}
+
+ if (count == 3)
+ {
+ c = readchar (readcharfun);
+ if ((c >= '0' && c <= '9') ||
+ (c >= 'a' && c <= 'f') ||
+ (c >= 'A' && c <= 'F'))
+ {
+ Lisp_Object args[2];
+
+ if (c >= '0' && c <= '9') i = (i
<< 4) + (c - '0');
+ else if (c >= 'a' && c <= 'f') i = (i
<< 4) + (c - 'a') + 10;
+ else if (c >= 'A' && c <= 'F') i = (i
<< 4) + (c - 'A') + 10;
+
+ args[0] = build_string ("?\\x%x");
+ args[1] = make_int (i);
+ syntax_error ("Overlong hex character escape",
+ Fformat (2, args));
+ }
+ unreadchar (readcharfun, c);
+ }
+
return i;
}
case 'U':
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches