diff options
| author | Kenichi Handa | 2008-07-04 02:22:42 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-07-04 02:22:42 +0000 |
| commit | 6e8b42de75400d361c8dccc0d91b41b6aceb0dc0 (patch) | |
| tree | 9a94c5d71ec94a1bd597c4e61e5eb1b6213a3024 | |
| parent | f27f70ecd301c51667ec2acbed9f9729a26f520a (diff) | |
| download | emacs-6e8b42de75400d361c8dccc0d91b41b6aceb0dc0.tar.gz emacs-6e8b42de75400d361c8dccc0d91b41b6aceb0dc0.zip | |
(Fstring_to_unibyte): Delete the arg ACCEPT-LATIN-1.
| -rw-r--r-- | src/fns.c | 14 |
1 files changed, 6 insertions, 8 deletions
| @@ -1132,17 +1132,15 @@ correct sequence. */) | |||
| 1132 | } | 1132 | } |
| 1133 | 1133 | ||
| 1134 | DEFUN ("string-to-unibyte", Fstring_to_unibyte, Sstring_to_unibyte, | 1134 | DEFUN ("string-to-unibyte", Fstring_to_unibyte, Sstring_to_unibyte, |
| 1135 | 1, 2, 0, | 1135 | 1, 1, 0, |
| 1136 | doc: /* Return a unibyte string with the same individual chars as STRING. | 1136 | doc: /* Return a unibyte string with the same individual chars as STRING. |
| 1137 | If STRING is unibyte, the result is STRING itself. | 1137 | If STRING is unibyte, the result is STRING itself. |
| 1138 | Otherwise it is a newly created string, with no text properties, | 1138 | Otherwise it is a newly created string, with no text properties, |
| 1139 | where each `eight-bit' character is converted to the corresponding byte. | 1139 | where each `eight-bit' character is converted to the corresponding byte. |
| 1140 | If STRING contains a non-ASCII, non-`eight-bit' character, | 1140 | If STRING contains a non-ASCII, non-`eight-bit' character, |
| 1141 | an error is signaled. | 1141 | an error is signaled. */) |
| 1142 | If the optional 2nd arg ACCEPT-LATIN-1 is non-nil, a Latin-1 character | 1142 | (string) |
| 1143 | doesn't cause an error, but is converted to a byte of same code. */) | 1143 | Lisp_Object string; |
| 1144 | (string, accept_latin_1) | ||
| 1145 | Lisp_Object string, accept_latin_1; | ||
| 1146 | { | 1144 | { |
| 1147 | CHECK_STRING (string); | 1145 | CHECK_STRING (string); |
| 1148 | 1146 | ||
| @@ -1150,8 +1148,8 @@ doesn't cause an error, but is converted to a byte of same code. */) | |||
| 1150 | { | 1148 | { |
| 1151 | EMACS_INT chars = SCHARS (string); | 1149 | EMACS_INT chars = SCHARS (string); |
| 1152 | unsigned char *str = (unsigned char *) xmalloc (chars); | 1150 | unsigned char *str = (unsigned char *) xmalloc (chars); |
| 1153 | EMACS_INT converted = str_to_unibyte (SDATA (string), str, chars, | 1151 | EMACS_INT converted = str_to_unibyte (SDATA (string), str, chars, 0); |
| 1154 | ! NILP (accept_latin_1)); | 1152 | |
| 1155 | if (converted < chars) | 1153 | if (converted < chars) |
| 1156 | error ("Can't convert the %dth character to unibyte", converted); | 1154 | error ("Can't convert the %dth character to unibyte", converted); |
| 1157 | string = make_unibyte_string (str, chars); | 1155 | string = make_unibyte_string (str, chars); |