[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r117378: Simplify and cleanup character conversion s
From: |
Dmitry Antipov |
Subject: |
[Emacs-diffs] trunk r117378: Simplify and cleanup character conversion stuff. |
Date: |
Mon, 23 Jun 2014 04:12:52 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117378
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Mon 2014-06-23 08:11:29 +0400
message:
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.
modified:
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/buffer.c buffer.c-20091113204419-o5vbwnq5f7feedwu-264
src/character.c
character.c-20091113204419-o5vbwnq5f7feedwu-8537
src/character.h
character.h-20091113204419-o5vbwnq5f7feedwu-8538
src/charset.c charset.c-20091113204419-o5vbwnq5f7feedwu-1075
src/charset.h charset.h-20091113204419-o5vbwnq5f7feedwu-1076
src/cmds.c cmds.c-20091113204419-o5vbwnq5f7feedwu-214
src/coding.c coding.c-20091113204419-o5vbwnq5f7feedwu-1077
src/editfns.c editfns.c-20091113204419-o5vbwnq5f7feedwu-255
src/fileio.c fileio.c-20091113204419-o5vbwnq5f7feedwu-210
src/indent.c indent.c-20091113204419-o5vbwnq5f7feedwu-181
src/insdel.c insdel.c-20091113204419-o5vbwnq5f7feedwu-175
src/keyboard.c keyboard.c-20091113204419-o5vbwnq5f7feedwu-449
src/lisp.h lisp.h-20091113204419-o5vbwnq5f7feedwu-253
src/lread.c lread.c-20091113204419-o5vbwnq5f7feedwu-266
src/print.c print.c-20091113204419-o5vbwnq5f7feedwu-262
src/search.c search.c-20091113204419-o5vbwnq5f7feedwu-473
src/term.c term.c-20091113204419-o5vbwnq5f7feedwu-220
src/xdisp.c xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
src/xterm.c xterm.c-20091113204419-o5vbwnq5f7feedwu-244
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2014-06-22 23:12:17 +0000
+++ b/src/ChangeLog 2014-06-23 04:11:29 +0000
@@ -1,3 +1,17 @@
+2014-06-23 Dmitry Antipov <address@hidden>
+
+ 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.
+
2014-06-22 Mario Lang <address@hidden>
* w32fns.c (Fw32_shell_execute): The the -> the.
=== modified file 'src/buffer.c'
--- a/src/buffer.c 2014-05-29 14:52:47 +0000
+++ b/src/buffer.c 2014-06-23 04:11:29 +0000
@@ -2530,7 +2530,7 @@
p = GAP_END_ADDR;
stop = Z;
}
- if (ASCII_BYTE_P (*p))
+ if (ASCII_CHAR_P (*p))
p++, pos++;
else if (CHAR_BYTE8_HEAD_P (*p))
{
@@ -2602,7 +2602,7 @@
stop = Z;
}
- if (ASCII_BYTE_P (*p))
+ if (ASCII_CHAR_P (*p))
p++, pos++;
else if (EQ (flag, Qt)
&& ! CHAR_BYTE8_HEAD_P (*p)
=== modified file 'src/character.c'
--- a/src/character.c 2014-01-01 07:43:34 +0000
+++ b/src/character.c 2014-06-23 04:11:29 +0000
@@ -233,32 +233,6 @@
return c;
}
-/* Convert ASCII or 8-bit character C to unibyte. If C is none of
- them, return (C & 0xFF). */
-
-int
-multibyte_char_to_unibyte (int c)
-{
- if (c < 0x80)
- return c;
- if (CHAR_BYTE8_P (c))
- return CHAR_TO_BYTE8 (c);
- return (c & 0xFF);
-}
-
-/* Like multibyte_char_to_unibyte, but return -1 if C is not supported
- by charset_unibyte. */
-
-int
-multibyte_char_to_unibyte_safe (int c)
-{
- if (c < 0x80)
- return c;
- if (CHAR_BYTE8_P (c))
- return CHAR_TO_BYTE8 (c);
- return -1;
-}
-
DEFUN ("characterp", Fcharacterp, Scharacterp, 1, 2, 0,
doc: /* Return non-nil if OBJECT is a character.
In Emacs Lisp, characters are represented by character codes, which
=== modified file 'src/character.h'
--- a/src/character.h 2014-02-14 16:11:11 +0000
+++ b/src/character.h 2014-06-23 04:11:29 +0000
@@ -67,20 +67,15 @@
#define BYTE8_TO_CHAR(byte) ((byte) + 0x3FFF00)
#define UNIBYTE_TO_CHAR(byte) \
- (ASCII_BYTE_P (byte) ? (byte) : BYTE8_TO_CHAR (byte))
+ (ASCII_CHAR_P (byte) ? (byte) : BYTE8_TO_CHAR (byte))
/* Return the raw 8-bit byte for character C. */
-#define CHAR_TO_BYTE8(c) \
- (CHAR_BYTE8_P (c) \
- ? (c) - 0x3FFF00 \
- : multibyte_char_to_unibyte (c))
+#define CHAR_TO_BYTE8(c) (CHAR_BYTE8_P (c) ? (c) - 0x3FFF00 : (c & 0xFF))
/* Return the raw 8-bit byte for character C,
or -1 if C doesn't correspond to a byte. */
-#define CHAR_TO_BYTE_SAFE(c) \
- (CHAR_BYTE8_P (c) \
- ? (c) - 0x3FFF00 \
- : multibyte_char_to_unibyte_safe (c))
+#define CHAR_TO_BYTE_SAFE(c) \
+ (ASCII_CHAR_P (c) ? c : (CHAR_BYTE8_P (c) ? (c) - 0x3FFF00 : -1))
/* Nonzero iff BYTE is the 1st byte of a multibyte form of a character
that corresponds to a raw 8-bit byte. */
@@ -101,13 +96,6 @@
/* This is the maximum byte length of multibyte form. */
#define MAX_MULTIBYTE_LENGTH 5
-/* Return a Lisp character whose character code is C. Assumes C is
- a valid character code. */
-#define make_char(c) make_number (c)
-
-/* Nonzero iff C is an ASCII byte. */
-#define ASCII_BYTE_P(c) UNSIGNED_CMP (c, <, 0x80)
-
/* Nonzero iff X is a character. */
#define CHARACTERP(x) (NATNUMP (x) && XFASTINT (x) <= MAX_CHAR)
@@ -222,7 +210,7 @@
/* Nonzero iff BYTE starts a character in a multibyte form.
This is equivalent to:
- (ASCII_BYTE_P (byte) || LEADING_CODE_P (byte)) */
+ (ASCII_CHAR_P (byte) || LEADING_CODE_P (byte)) */
#define CHAR_HEAD_P(byte) (((byte) & 0xC0) != 0x80)
/* How many bytes a character that starts with BYTE occupies in a
=== modified file 'src/charset.c'
--- a/src/charset.c 2014-04-05 19:30:36 +0000
+++ b/src/charset.c 2014-06-23 04:11:29 +0000
@@ -389,12 +389,12 @@
{
if (ascii_compatible_p)
{
- if (! ASCII_BYTE_P (from_c))
+ if (! ASCII_CHAR_P (from_c))
{
if (from_c < nonascii_min_char)
nonascii_min_char = from_c;
}
- else if (! ASCII_BYTE_P (to_c))
+ else if (! ASCII_CHAR_P (to_c))
{
nonascii_min_char = 0x80;
}
@@ -1522,7 +1522,7 @@
if (!NILP (table))
c = translate_char (table, c);
- if (ASCII_BYTE_P (c))
+ if (ASCII_CHAR_P (c))
ASET (charsets, charset_ascii, Qt);
else
ASET (charsets, charset_eight_bit, Qt);
=== modified file 'src/charset.h'
--- a/src/charset.h 2014-01-01 07:43:34 +0000
+++ b/src/charset.h 2014-06-23 04:11:29 +0000
@@ -403,7 +403,7 @@
Try some optimization before calling decode_char. */
#define DECODE_CHAR(charset, code) \
- ((ASCII_BYTE_P (code) && (charset)->ascii_compatible_p) \
+ ((ASCII_CHAR_P (code) && (charset)->ascii_compatible_p) \
? (code) \
: ((code) < (charset)->min_code || (code) > (charset)->max_code) \
? -1
\
=== modified file 'src/cmds.c'
--- a/src/cmds.c 2014-06-02 00:18:22 +0000
+++ b/src/cmds.c 2014-06-23 04:11:29 +0000
@@ -359,9 +359,7 @@
}
else
{
- str[0] = (SINGLE_BYTE_CHAR_P (c)
- ? c
- : multibyte_char_to_unibyte (c));
+ str[0] = SINGLE_BYTE_CHAR_P (c) ? c : CHAR_TO_BYTE8 (c);
len = 1;
}
if (!NILP (overwrite)
=== modified file 'src/coding.c'
--- a/src/coding.c 2014-04-05 19:30:36 +0000
+++ b/src/coding.c 2014-06-23 04:11:29 +0000
@@ -1485,7 +1485,7 @@
src = src_base;
consumed_chars = consumed_chars_base;
ONE_MORE_BYTE (c);
- *charbuf++ = ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c);
+ *charbuf++ = ASCII_CHAR_P (c) ? c : BYTE8_TO_CHAR (c);
coding->errors++;
}
@@ -1725,7 +1725,7 @@
ONE_MORE_BYTE (c2);
if (c2 < 0)
{
- *charbuf++ = ASCII_BYTE_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
+ *charbuf++ = ASCII_CHAR_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
*charbuf++ = -c2;
continue;
}
@@ -2108,7 +2108,7 @@
case 1:
code = c;
- charset_ID = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit;
+ charset_ID = ASCII_CHAR_P (code) ? charset_ascii : charset_eight_bit;
break;
default:
@@ -2596,7 +2596,7 @@
src = src_base;
consumed_chars = consumed_chars_base;
ONE_MORE_BYTE (c);
- *charbuf++ = ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c);
+ *charbuf++ = ASCII_CHAR_P (c) ? c : BYTE8_TO_CHAR (c);
char_offset++;
coding->errors++;
}
@@ -3573,7 +3573,7 @@
if (CODING_ISO_EXTSEGMENT_LEN (coding) > 0)
{
- *charbuf++ = ASCII_BYTE_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
+ *charbuf++ = ASCII_CHAR_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
char_offset++;
CODING_ISO_EXTSEGMENT_LEN (coding)--;
continue;
@@ -3600,7 +3600,7 @@
}
else
{
- *charbuf++ = ASCII_BYTE_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
+ *charbuf++ = ASCII_CHAR_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
char_offset++;
}
continue;
@@ -3974,7 +3974,7 @@
MAYBE_FINISH_COMPOSITION ();
for (; src_base < src; src_base++, char_offset++)
{
- if (ASCII_BYTE_P (*src_base))
+ if (ASCII_CHAR_P (*src_base))
*charbuf++ = *src_base;
else
*charbuf++ = BYTE8_TO_CHAR (*src_base);
@@ -4004,7 +4004,7 @@
src = src_base;
consumed_chars = consumed_chars_base;
ONE_MORE_BYTE (c);
- *charbuf++ = c < 0 ? -c : ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c);
+ *charbuf++ = c < 0 ? -c : ASCII_CHAR_P (c) ? c : BYTE8_TO_CHAR (c);
char_offset++;
coding->errors++;
/* Reset the invocation and designation status to the safest
@@ -5640,7 +5640,7 @@
src = src_base;
consumed_chars = consumed_chars_base;
ONE_MORE_BYTE (c);
- *charbuf++ = c < 0 ? -c : ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c);
+ *charbuf++ = c < 0 ? -c : ASCII_CHAR_P (c) ? c : BYTE8_TO_CHAR (c);
char_offset++;
coding->errors++;
}
@@ -9031,13 +9031,13 @@
p = pbeg = BYTE_POS_ADDR (start_byte);
pend = p + (end_byte - start_byte);
- while (p < pend && ASCII_BYTE_P (*p)) p++;
- while (p < pend && ASCII_BYTE_P (*(pend - 1))) pend--;
+ while (p < pend && ASCII_CHAR_P (*p)) p++;
+ while (p < pend && ASCII_CHAR_P (*(pend - 1))) pend--;
work_table = Fmake_char_table (Qnil, Qnil);
while (p < pend)
{
- if (ASCII_BYTE_P (*p))
+ if (ASCII_CHAR_P (*p))
p++;
else
{
@@ -9169,7 +9169,7 @@
int c;
if (ascii_compatible)
- while (p < stop && ASCII_BYTE_P (*p))
+ while (p < stop && ASCII_CHAR_P (*p))
p++, from++;
if (p >= stop)
{
@@ -9285,12 +9285,12 @@
p = pbeg = BYTE_POS_ADDR (start_byte);
pend = p + (end_byte - start_byte);
- while (p < pend && ASCII_BYTE_P (*p)) p++, pos++;
- while (p < pend && ASCII_BYTE_P (*(pend - 1))) pend--;
+ while (p < pend && ASCII_CHAR_P (*p)) p++, pos++;
+ while (p < pend && ASCII_CHAR_P (*(pend - 1))) pend--;
while (p < pend)
{
- if (ASCII_BYTE_P (*p))
+ if (ASCII_CHAR_P (*p))
p++;
else
{
@@ -9598,7 +9598,7 @@
CHECK_CODING_SYSTEM_GET_SPEC (Vsjis_coding_system, spec);
attrs = AREF (spec, 0);
- if (ASCII_BYTE_P (ch)
+ if (ASCII_CHAR_P (ch)
&& ! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
return code;
@@ -9679,7 +9679,7 @@
CHECK_CODING_SYSTEM_GET_SPEC (Vbig5_coding_system, spec);
attrs = AREF (spec, 0);
- if (ASCII_BYTE_P (ch)
+ if (ASCII_CHAR_P (ch)
&& ! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
return code;
=== modified file 'src/editfns.c'
--- a/src/editfns.c 2014-06-17 13:50:22 +0000
+++ b/src/editfns.c 2014-06-23 04:11:29 +0000
@@ -2238,7 +2238,7 @@
len = CHAR_STRING (c, str);
else
{
- str[0] = ASCII_CHAR_P (c) ? c : multibyte_char_to_unibyte (c);
+ str[0] = CHAR_TO_BYTE8 (c);
len = 1;
}
(*insert_func) ((char *) str, len);
@@ -2852,7 +2852,7 @@
len = CHAR_STRING (fromc, fromstr);
if (CHAR_STRING (toc, tostr) != len)
error ("Characters in `subst-char-in-region' have different
byte-lengths");
- if (!ASCII_BYTE_P (*tostr))
+ if (!ASCII_CHAR_P (*tostr))
{
/* If *TOSTR is in the range 0x80..0x9F and TOCHAR is not a
complete multibyte character, it may be combined with the
@@ -2945,7 +2945,7 @@
: ((pos_byte_next < Z_BYTE
&& ! CHAR_HEAD_P (FETCH_BYTE (pos_byte_next)))
|| (pos_byte > BEG_BYTE
- && ! ASCII_BYTE_P (FETCH_BYTE (pos_byte - 1))))))
+ && ! ASCII_CHAR_P (FETCH_BYTE (pos_byte - 1))))))
{
Lisp_Object tem, string;
@@ -3126,7 +3126,7 @@
else
{
nc = tt[oc];
- if (! ASCII_BYTE_P (nc) && multibyte)
+ if (! ASCII_CHAR_P (nc) && multibyte)
{
str_len = BYTE8_STRING (nc, buf);
str = buf;
@@ -3877,7 +3877,7 @@
if (p > buf
&& multibyte
- && !ASCII_BYTE_P (*((unsigned char *) p - 1))
+ && !ASCII_CHAR_P (*((unsigned char *) p - 1))
&& STRING_MULTIBYTE (args[n])
&& !CHAR_HEAD_P (SREF (args[n], 0)))
maybe_combine_byte = 1;
@@ -4167,7 +4167,7 @@
{
/* Copy a whole multibyte character. */
if (p > buf
- && !ASCII_BYTE_P (*((unsigned char *) p - 1))
+ && !ASCII_CHAR_P (*((unsigned char *) p - 1))
&& !CHAR_HEAD_P (*format))
maybe_combine_byte = 1;
@@ -4181,7 +4181,7 @@
else
{
unsigned char uc = *format++;
- if (! multibyte || ASCII_BYTE_P (uc))
+ if (! multibyte || ASCII_CHAR_P (uc))
convbytes = 1;
else
{
=== modified file 'src/fileio.c'
--- a/src/fileio.c 2014-06-21 19:45:59 +0000
+++ b/src/fileio.c 2014-06-23 04:11:29 +0000
@@ -990,7 +990,7 @@
{
unsigned char *p = SDATA (name);
- while (*p && ASCII_BYTE_P (*p))
+ while (*p && ASCII_CHAR_P (*p))
p++;
if (*p == '\0')
{
=== modified file 'src/indent.c'
--- a/src/indent.c 2014-06-21 12:30:02 +0000
+++ b/src/indent.c 2014-06-23 04:11:29 +0000
@@ -920,7 +920,7 @@
column += tab_width - column % tab_width;
break;
default:
- if (ASCII_BYTE_P (p[-1])
+ if (ASCII_CHAR_P (p[-1])
|| NILP (BVAR (current_buffer, enable_multibyte_characters)))
return column;
{
=== modified file 'src/insdel.c'
--- a/src/insdel.c 2014-04-18 23:36:51 +0000
+++ b/src/insdel.c 2014-06-23 04:11:29 +0000
@@ -701,7 +701,7 @@
(2) POS is the last of the current buffer.
(3) A character at POS can't be a following byte of multibyte
character. */
- if (length > 0 && ASCII_BYTE_P (string[length - 1])) /* case (1) */
+ if (length > 0 && ASCII_CHAR_P (string[length - 1])) /* case (1) */
return 0;
if (pos_byte == Z_BYTE) /* case (2) */
return 0;
=== modified file 'src/keyboard.c'
--- a/src/keyboard.c 2014-06-21 19:45:59 +0000
+++ b/src/keyboard.c 2014-06-23 04:11:29 +0000
@@ -2084,7 +2084,7 @@
/* Save the upper bits here. */
int upper = c & ~0177;
- if (! ASCII_BYTE_P (c))
+ if (! ASCII_CHAR_P (c))
return c |= ctrl_modifier;
c &= 0177;
=== modified file 'src/lisp.h'
--- a/src/lisp.h 2014-06-17 16:09:19 +0000
+++ b/src/lisp.h 2014-06-23 04:11:29 +0000
@@ -3433,8 +3433,6 @@
/* Defined in character.c. */
extern ptrdiff_t chars_in_text (const unsigned char *, ptrdiff_t);
extern ptrdiff_t multibyte_chars_in_text (const unsigned char *, ptrdiff_t);
-extern int multibyte_char_to_unibyte (int) ATTRIBUTE_CONST;
-extern int multibyte_char_to_unibyte_safe (int) ATTRIBUTE_CONST;
extern void syms_of_character (void);
/* Defined in charset.c. */
=== modified file 'src/lread.c'
--- a/src/lread.c 2014-06-17 13:50:22 +0000
+++ b/src/lread.c 2014-06-23 04:11:29 +0000
@@ -213,7 +213,7 @@
else
{
c = BUF_FETCH_BYTE (inbuffer, pt_byte);
- if (! ASCII_BYTE_P (c))
+ if (! ASCII_CHAR_P (c))
c = BYTE8_TO_CHAR (c);
pt_byte++;
}
@@ -242,7 +242,7 @@
else
{
c = BUF_FETCH_BYTE (inbuffer, bytepos);
- if (! ASCII_BYTE_P (c))
+ if (! ASCII_CHAR_P (c))
c = BYTE8_TO_CHAR (c);
bytepos++;
}
@@ -324,7 +324,7 @@
return c;
if (multibyte)
*multibyte = 1;
- if (ASCII_BYTE_P (c))
+ if (ASCII_CHAR_P (c))
return c;
if (emacs_mule_encoding)
return read_emacs_mule_char (c, readbyte, readcharfun);
=== modified file 'src/print.c'
--- a/src/print.c 2014-02-03 07:05:28 +0000
+++ b/src/print.c 2014-06-23 04:11:29 +0000
@@ -1472,7 +1472,7 @@
strout (outbuf, len, len, printcharfun);
}
else if (! multibyte
- && SINGLE_BYTE_CHAR_P (c) && ! ASCII_BYTE_P (c)
+ && SINGLE_BYTE_CHAR_P (c) && ! ASCII_CHAR_P (c)
&& print_escape_nonascii)
{
/* When printing in a multibyte buffer
=== modified file 'src/search.c'
--- a/src/search.c 2014-04-25 16:11:07 +0000
+++ b/src/search.c 2014-06-23 04:11:29 +0000
@@ -1416,7 +1416,7 @@
while (boyer_moore_ok)
{
- if (ASCII_BYTE_P (inverse))
+ if (ASCII_CHAR_P (inverse))
{
if (this_char_base > 0)
boyer_moore_ok = 0;
@@ -1827,7 +1827,7 @@
matching with CHAR_BASE are to be checked. */
int ch = -1;
- if (ASCII_BYTE_P (*ptr) || ! multibyte)
+ if (ASCII_CHAR_P (*ptr) || ! multibyte)
ch = *ptr;
else if (char_base
&& ((pat_end - ptr) == 1 || CHAR_HEAD_P (ptr[1])))
@@ -2596,7 +2596,7 @@
{
FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, newtext, pos, pos_byte);
if (!buf_multibyte)
- c = multibyte_char_to_unibyte (c);
+ c = CHAR_TO_BYTE8 (c);
}
else
{
@@ -2619,7 +2619,7 @@
FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, newtext,
pos, pos_byte);
if (!buf_multibyte && !ASCII_CHAR_P (c))
- c = multibyte_char_to_unibyte (c);
+ c = CHAR_TO_BYTE8 (c);
}
else
{
=== modified file 'src/term.c'
--- a/src/term.c 2014-06-08 18:27:22 +0000
+++ b/src/term.c 2014-06-23 04:11:29 +0000
@@ -1861,7 +1861,7 @@
acronym = XCDR (acronym);
buf[0] = '[';
str = STRINGP (acronym) ? SSDATA (acronym) : "";
- for (len = 0; len < 6 && str[len] && ASCII_BYTE_P (str[len]); len++)
+ for (len = 0; len < 6 && str[len] && ASCII_CHAR_P (str[len]); len++)
buf[1 + len] = str[len];
buf[1 + len] = ']';
len += 2;
=== modified file 'src/xdisp.c'
--- a/src/xdisp.c 2014-06-21 19:45:59 +0000
+++ b/src/xdisp.c 2014-06-23 04:11:29 +0000
@@ -8269,7 +8269,7 @@
/* Get the next character, maybe multibyte. */
p = BYTE_POS_ADDR (IT_BYTEPOS (*it));
- if (it->multibyte_p && !ASCII_BYTE_P (*p))
+ if (it->multibyte_p && !ASCII_CHAR_P (*p))
it->c = STRING_CHAR_AND_LENGTH (p, it->len);
else
it->c = *p, it->len = 1;
@@ -9932,9 +9932,7 @@
for (i = 0; i < nbytes; i += char_bytes)
{
c = string_char_and_length (msg + i, &char_bytes);
- work[0] = (ASCII_CHAR_P (c)
- ? c
- : multibyte_char_to_unibyte (c));
+ work[0] = CHAR_TO_BYTE8 (c);
insert_1_both (work, 1, 1, 1, 0, 0);
}
}
@@ -25781,7 +25779,7 @@
sprintf (buf, "%0*X", it->c < 0x10000 ? 4 : 6, it->c);
str = buf;
}
- for (len = 0; str[len] && ASCII_BYTE_P (str[len]) && len < 6; len++)
+ for (len = 0; str[len] && ASCII_CHAR_P (str[len]) && len < 6; len++)
code[len] = font->driver->encode_char (font, str[len]);
upper_len = (len + 1) / 2;
font->driver->text_extents (font, code, upper_len,
=== modified file 'src/xterm.c'
--- a/src/xterm.c 2014-06-22 05:00:14 +0000
+++ b/src/xterm.c 2014-06-23 04:11:29 +0000
@@ -6460,7 +6460,7 @@
for (i = 0, nchars = 0; i < nbytes; i++)
{
- if (ASCII_BYTE_P (copy_bufptr[i]))
+ if (ASCII_CHAR_P (copy_bufptr[i]))
nchars++;
STORE_KEYSYM_FOR_DEBUG (copy_bufptr[i]);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r117378: Simplify and cleanup character conversion stuff.,
Dmitry Antipov <=