diff options
| author | Richard M. Stallman | 1998-11-27 22:15:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-11-27 22:15:38 +0000 |
| commit | f4e09ae7107491e46bbbd984bd56c206498910e3 (patch) | |
| tree | c19e54502577709d17d0b297b22a467eb4f7f199 /src/fns.c | |
| parent | 6f39b7c89b5a60bb4c3f0270b162a5874d13aedd (diff) | |
| download | emacs-f4e09ae7107491e46bbbd984bd56c206498910e3.tar.gz emacs-f4e09ae7107491e46bbbd984bd56c206498910e3.zip | |
(Fstring_as_unibyte, Fstring_as_multibyte):
Clear text properties in the new string.
Diffstat (limited to 'src/fns.c')
| -rw-r--r-- | src/fns.c | 9 |
1 files changed, 7 insertions, 2 deletions
| @@ -1002,7 +1002,9 @@ by using just the low 8 bits.") | |||
| 1002 | DEFUN ("string-as-unibyte", Fstring_as_unibyte, Sstring_as_unibyte, | 1002 | DEFUN ("string-as-unibyte", Fstring_as_unibyte, Sstring_as_unibyte, |
| 1003 | 1, 1, 0, | 1003 | 1, 1, 0, |
| 1004 | "Return a unibyte string with the same individual bytes as STRING.\n\ | 1004 | "Return a unibyte string with the same individual bytes as STRING.\n\ |
| 1005 | If STRING is unibyte, the result is STRING itself.") | 1005 | If STRING is unibyte, the result is STRING itself.\n\ |
| 1006 | If STRING is multibyte, the result is STRING itself.\n\ | ||
| 1007 | Otherwise it is a newly created string, with no text properties.") | ||
| 1006 | (string) | 1008 | (string) |
| 1007 | Lisp_Object string; | 1009 | Lisp_Object string; |
| 1008 | { | 1010 | { |
| @@ -1012,6 +1014,7 @@ If STRING is unibyte, the result is STRING itself.") | |||
| 1012 | { | 1014 | { |
| 1013 | string = Fcopy_sequence (string); | 1015 | string = Fcopy_sequence (string); |
| 1014 | XSTRING (string)->size = STRING_BYTES (XSTRING (string)); | 1016 | XSTRING (string)->size = STRING_BYTES (XSTRING (string)); |
| 1017 | XSTRING (string)->intervals = NULL_INTERVAL; | ||
| 1015 | SET_STRING_BYTES (XSTRING (string), -1); | 1018 | SET_STRING_BYTES (XSTRING (string), -1); |
| 1016 | } | 1019 | } |
| 1017 | return string; | 1020 | return string; |
| @@ -1020,7 +1023,8 @@ If STRING is unibyte, the result is STRING itself.") | |||
| 1020 | DEFUN ("string-as-multibyte", Fstring_as_multibyte, Sstring_as_multibyte, | 1023 | DEFUN ("string-as-multibyte", Fstring_as_multibyte, Sstring_as_multibyte, |
| 1021 | 1, 1, 0, | 1024 | 1, 1, 0, |
| 1022 | "Return a multibyte string with the same individual bytes as STRING.\n\ | 1025 | "Return a multibyte string with the same individual bytes as STRING.\n\ |
| 1023 | If STRING is multibyte, the result is STRING itself.") | 1026 | If STRING is multibyte, the result is STRING itself.\n\ |
| 1027 | Otherwise it is a newly created string, with no text properties.") | ||
| 1024 | (string) | 1028 | (string) |
| 1025 | Lisp_Object string; | 1029 | Lisp_Object string; |
| 1026 | { | 1030 | { |
| @@ -1034,6 +1038,7 @@ If STRING is multibyte, the result is STRING itself.") | |||
| 1034 | string = Fcopy_sequence (string); | 1038 | string = Fcopy_sequence (string); |
| 1035 | XSTRING (string)->size = newlen; | 1039 | XSTRING (string)->size = newlen; |
| 1036 | XSTRING (string)->size_byte = nbytes; | 1040 | XSTRING (string)->size_byte = nbytes; |
| 1041 | XSTRING (string)->intervals = NULL_INTERVAL; | ||
| 1037 | } | 1042 | } |
| 1038 | return string; | 1043 | return string; |
| 1039 | } | 1044 | } |