]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fstring_as_unibyte, Fstring_as_multibyte):
authorRichard M. Stallman <rms@gnu.org>
Fri, 27 Nov 1998 22:15:38 +0000 (22:15 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 27 Nov 1998 22:15:38 +0000 (22:15 +0000)
Clear text properties in the new string.

src/fns.c

index 966e13fe17b666a831dc03fd6c4624dea79c5a0e..15ce7379dc7fb2e2fb05b344be5cf06be7406138 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -1002,7 +1002,9 @@ by using just the low 8 bits.")
 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;
 {
@@ -1012,6 +1014,7 @@ If STRING is unibyte, the result is STRING itself.")
     {
       string = Fcopy_sequence (string);
       XSTRING (string)->size = STRING_BYTES (XSTRING (string));
+      XSTRING (string)->intervals = NULL_INTERVAL;
       SET_STRING_BYTES (XSTRING (string), -1);
     }
   return string;
@@ -1020,7 +1023,8 @@ If STRING is unibyte, the result is STRING itself.")
 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;
 {
@@ -1034,6 +1038,7 @@ If STRING is multibyte, the result is STRING itself.")
       string = Fcopy_sequence (string);
       XSTRING (string)->size = newlen;
       XSTRING (string)->size_byte = nbytes;
+      XSTRING (string)->intervals = NULL_INTERVAL;
     }
   return string;
 }