return Qnil;
}
-DEFUN ("atom", Fatom, Satom, 1, 1, 0, "Return t if OBJECT is not a cons cell. This includes nil.")
+DEFUN ("atom", Fatom, Satom, 1, 1, 0,
+ "Return t if OBJECT is not a cons cell. This includes nil.")
(object)
Lisp_Object object;
{
return Qt;
}
-DEFUN ("listp", Flistp, Slistp, 1, 1, 0, "Return t if OBJECT is a list. This includes nil.")
+DEFUN ("listp", Flistp, Slistp, 1, 1, 0,
+ "Return t if OBJECT is a list. This includes nil.")
(object)
Lisp_Object object;
{
return Qnil;
}
-DEFUN ("nlistp", Fnlistp, Snlistp, 1, 1, 0, "Return t if OBJECT is not a list. Lists include nil.")
+DEFUN ("nlistp", Fnlistp, Snlistp, 1, 1, 0,
+ "Return t if OBJECT is not a list. Lists include nil.")
(object)
Lisp_Object object;
{
return Qt;
}
\f
-DEFUN ("symbolp", Fsymbolp, Ssymbolp, 1, 1, 0, "Return t if OBJECT is a symbol.")
+DEFUN ("symbolp", Fsymbolp, Ssymbolp, 1, 1, 0,
+ "Return t if OBJECT is a symbol.")
(object)
Lisp_Object object;
{
return Qnil;
}
-DEFUN ("vectorp", Fvectorp, Svectorp, 1, 1, 0, "Return t if OBJECT is a vector.")
+DEFUN ("vectorp", Fvectorp, Svectorp, 1, 1, 0,
+ "Return t if OBJECT is a vector.")
(object)
Lisp_Object object;
{
return Qnil;
}
-DEFUN ("stringp", Fstringp, Sstringp, 1, 1, 0, "Return t if OBJECT is a string.")
+DEFUN ("stringp", Fstringp, Sstringp, 1, 1, 0,
+ "Return t if OBJECT is a string.")
(object)
Lisp_Object object;
{
return Qnil;
}
-DEFUN ("char-table-p", Fchar_table_p, Schar_table_p, 1, 1, 0, "Return t if OBJECT is a char-table.")
+DEFUN ("multibyte-string-p", Fmultibyte_string_p, Smultibyte_string_p,
+ 1, 1, 0, "Return t if OBJECT is a multibyte string.")
+ (object)
+ Lisp_Object object;
+{
+ if (STRINGP (object) && STRING_MULTIBYTE (object))
+ return Qt;
+ return Qnil;
+}
+
+DEFUN ("char-table-p", Fchar_table_p, Schar_table_p, 1, 1, 0,
+ "Return t if OBJECT is a char-table.")
(object)
Lisp_Object object;
{
return set_internal (symbol, newval, 0);
}
-/* Stpre the value NEWVAL into SYMBOL.
+/* Store the value NEWVAL into SYMBOL.
If BINDFLAG is zero, then if this symbol is supposed to become
local in every buffer where it is set, then we make it local.
If BINDFLAG is nonzero, we don't do that. */
if (STRINGP (array))
{
Lisp_Object val;
+ int c, idxval_byte;
+
if (idxval < 0 || idxval >= XSTRING (array)->size)
args_out_of_range (array, idx);
- XSETFASTINT (val, (unsigned char) XSTRING (array)->data[idxval]);
- return val;
+ if (! STRING_MULTIBYTE (array))
+ return make_number ((unsigned char) XSTRING (array)->data[idxval]);
+ idxval_byte = string_char_to_byte (array, idxval);
+
+ c = STRING_CHAR (&XSTRING (array)->data[idxval_byte],
+ XSTRING (array)->size_byte - idxval_byte);
+ return make_number (c);
}
else if (BOOL_VECTOR_P (array))
{
XCHAR_TABLE (array)->contents[code[i]] = newelt;
}
}
+ else if (STRING_MULTIBYTE (array))
+ {
+ Lisp_Object val;
+ int c, idxval_byte, actual_len;
+
+ if (idxval < 0 || idxval >= XSTRING (array)->size)
+ args_out_of_range (array, idx);
+
+ idxval_byte = string_char_to_byte (array, idxval);
+
+ c = STRING_CHAR_AND_LENGTH (&XSTRING (array)->data[idxval_byte],
+ XSTRING (array)->size_byte - idxval_byte,
+ actual_len);
+ if (actual_len != 1)
+ error ("Attempt to store a multibyte character into a string");
+
+ CHECK_NUMBER (newelt, 2);
+ XSTRING (array)->data[idxval_byte] = XINT (newelt);
+ }
else
{
if (idxval < 0 || idxval >= XSTRING (array)->size)