diff options
| author | Dmitry Antipov | 2014-06-23 08:11:29 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-06-23 08:11:29 +0400 |
| commit | 200fc9496f7e2d53610e31634fdcd750d1870279 (patch) | |
| tree | 50114538abd0729d13d05e95a3f48dbb742f5528 /src/editfns.c | |
| parent | 33848c48a5e8823f44994624443fabdf615292dc (diff) | |
| download | emacs-200fc9496f7e2d53610e31634fdcd750d1870279.tar.gz emacs-200fc9496f7e2d53610e31634fdcd750d1870279.zip | |
Simplify and cleanup character conversion stuff.
* lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe):
Remove prototypes.
* character.c (multibyte_char_to_unibyte)
(multibyte_char_to_unibyte_safe): Remove; no longer used.
* character.h (make_char): Remove; unused.
(CHAR_TO_BYTE8, CHAR_TO_BYTE_SAFE): Simplify.
(ASCII_BYTE_P): Remove; ASCII_CHAR_P does the same thing.
* buffer.c, charset.c, charset.h, cmds.c, coding.c, editfns.c:
* fileio.c, indent.c, insdel.c, keyboard.c, lread.c, print.c:
* search.c, term.c, xdisp.c, xterm.c: Related users changed.
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/editfns.c b/src/editfns.c index 40fac27ba47..e8d4478f2f6 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -2238,7 +2238,7 @@ general_insert_function (void (*insert_func) | |||
| 2238 | len = CHAR_STRING (c, str); | 2238 | len = CHAR_STRING (c, str); |
| 2239 | else | 2239 | else |
| 2240 | { | 2240 | { |
| 2241 | str[0] = ASCII_CHAR_P (c) ? c : multibyte_char_to_unibyte (c); | 2241 | str[0] = CHAR_TO_BYTE8 (c); |
| 2242 | len = 1; | 2242 | len = 1; |
| 2243 | } | 2243 | } |
| 2244 | (*insert_func) ((char *) str, len); | 2244 | (*insert_func) ((char *) str, len); |
| @@ -2852,7 +2852,7 @@ Both characters must have the same length of multi-byte form. */) | |||
| 2852 | len = CHAR_STRING (fromc, fromstr); | 2852 | len = CHAR_STRING (fromc, fromstr); |
| 2853 | if (CHAR_STRING (toc, tostr) != len) | 2853 | if (CHAR_STRING (toc, tostr) != len) |
| 2854 | error ("Characters in `subst-char-in-region' have different byte-lengths"); | 2854 | error ("Characters in `subst-char-in-region' have different byte-lengths"); |
| 2855 | if (!ASCII_BYTE_P (*tostr)) | 2855 | if (!ASCII_CHAR_P (*tostr)) |
| 2856 | { | 2856 | { |
| 2857 | /* If *TOSTR is in the range 0x80..0x9F and TOCHAR is not a | 2857 | /* If *TOSTR is in the range 0x80..0x9F and TOCHAR is not a |
| 2858 | complete multibyte character, it may be combined with the | 2858 | complete multibyte character, it may be combined with the |
| @@ -2945,7 +2945,7 @@ Both characters must have the same length of multi-byte form. */) | |||
| 2945 | : ((pos_byte_next < Z_BYTE | 2945 | : ((pos_byte_next < Z_BYTE |
| 2946 | && ! CHAR_HEAD_P (FETCH_BYTE (pos_byte_next))) | 2946 | && ! CHAR_HEAD_P (FETCH_BYTE (pos_byte_next))) |
| 2947 | || (pos_byte > BEG_BYTE | 2947 | || (pos_byte > BEG_BYTE |
| 2948 | && ! ASCII_BYTE_P (FETCH_BYTE (pos_byte - 1)))))) | 2948 | && ! ASCII_CHAR_P (FETCH_BYTE (pos_byte - 1)))))) |
| 2949 | { | 2949 | { |
| 2950 | Lisp_Object tem, string; | 2950 | Lisp_Object tem, string; |
| 2951 | 2951 | ||
| @@ -3126,7 +3126,7 @@ It returns the number of characters changed. */) | |||
| 3126 | else | 3126 | else |
| 3127 | { | 3127 | { |
| 3128 | nc = tt[oc]; | 3128 | nc = tt[oc]; |
| 3129 | if (! ASCII_BYTE_P (nc) && multibyte) | 3129 | if (! ASCII_CHAR_P (nc) && multibyte) |
| 3130 | { | 3130 | { |
| 3131 | str_len = BYTE8_STRING (nc, buf); | 3131 | str_len = BYTE8_STRING (nc, buf); |
| 3132 | str = buf; | 3132 | str = buf; |
| @@ -3877,7 +3877,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3877 | 3877 | ||
| 3878 | if (p > buf | 3878 | if (p > buf |
| 3879 | && multibyte | 3879 | && multibyte |
| 3880 | && !ASCII_BYTE_P (*((unsigned char *) p - 1)) | 3880 | && !ASCII_CHAR_P (*((unsigned char *) p - 1)) |
| 3881 | && STRING_MULTIBYTE (args[n]) | 3881 | && STRING_MULTIBYTE (args[n]) |
| 3882 | && !CHAR_HEAD_P (SREF (args[n], 0))) | 3882 | && !CHAR_HEAD_P (SREF (args[n], 0))) |
| 3883 | maybe_combine_byte = 1; | 3883 | maybe_combine_byte = 1; |
| @@ -4167,7 +4167,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 4167 | { | 4167 | { |
| 4168 | /* Copy a whole multibyte character. */ | 4168 | /* Copy a whole multibyte character. */ |
| 4169 | if (p > buf | 4169 | if (p > buf |
| 4170 | && !ASCII_BYTE_P (*((unsigned char *) p - 1)) | 4170 | && !ASCII_CHAR_P (*((unsigned char *) p - 1)) |
| 4171 | && !CHAR_HEAD_P (*format)) | 4171 | && !CHAR_HEAD_P (*format)) |
| 4172 | maybe_combine_byte = 1; | 4172 | maybe_combine_byte = 1; |
| 4173 | 4173 | ||
| @@ -4181,7 +4181,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 4181 | else | 4181 | else |
| 4182 | { | 4182 | { |
| 4183 | unsigned char uc = *format++; | 4183 | unsigned char uc = *format++; |
| 4184 | if (! multibyte || ASCII_BYTE_P (uc)) | 4184 | if (! multibyte || ASCII_CHAR_P (uc)) |
| 4185 | convbytes = 1; | 4185 | convbytes = 1; |
| 4186 | else | 4186 | else |
| 4187 | { | 4187 | { |