DEFUN ("string-as-unibyte", Fstring_as_unibyte, Sstring_as_unibyte,
1, 1, 0,
"Return a unibyte string with the same individual bytes as STRING.\n\
-If STRING is unibyte, the result is STRING itself.")
+If STRING is unibyte, the result is STRING itself.\n\
+If STRING is multibyte, the result is STRING itself.\n\
+Otherwise it is a newly created string, with no text properties.")
(string)
Lisp_Object string;
{
{
string = Fcopy_sequence (string);
XSTRING (string)->size = STRING_BYTES (XSTRING (string));
+ XSTRING (string)->intervals = NULL_INTERVAL;
SET_STRING_BYTES (XSTRING (string), -1);
}
return string;
DEFUN ("string-as-multibyte", Fstring_as_multibyte, Sstring_as_multibyte,
1, 1, 0,
"Return a multibyte string with the same individual bytes as STRING.\n\
-If STRING is multibyte, the result is STRING itself.")
+If STRING is multibyte, the result is STRING itself.\n\
+Otherwise it is a newly created string, with no text properties.")
(string)
Lisp_Object string;
{
string = Fcopy_sequence (string);
XSTRING (string)->size = newlen;
XSTRING (string)->size_byte = nbytes;
+ XSTRING (string)->intervals = NULL_INTERVAL;
}
return string;
}