+2008-04-17 Kenichi Handa <handa@m17n.org>
+
+ * data.c (Faset): Allow setting a multibyte character in an
+ ASCII-only unibyte string.
+
+ * lisp.h (STRING_SET_MULTIBYTE): New macro.
+
2008-04-16 Stefan Monnier <monnier@iro.umontreal.ca>
* Makefile.in: Don't use HAVE_GTK and don't -DUSE_GTK since it's now
CHECK_NUMBER (newelt);
if (XINT (newelt) >= 0 && ! SINGLE_BYTE_CHAR_P (XINT (newelt)))
- args_out_of_range (array, newelt);
+ {
+ int i;
+
+ for (i = SBYTES (array) - 1; i >= 0; i--)
+ if (SREF (array, i) >= 0x80)
+ args_out_of_range (array, newelt);
+ /* ARRAY is an ASCII string. Convert it to a multibyte
+ string, and try `aset' again. */
+ STRING_SET_MULTIBYTE (array);
+ return Faset (array, idx, newelt);
+ }
SSET (array, idxval, XINT (newelt));
}