aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-03-21 17:48:54 +0000
committerRichard M. Stallman1998-03-21 17:48:54 +0000
commit2a1d8be0dc8ff03732c66150b2732cf6db72b3bc (patch)
tree538e12b2484c3cc90110b37e9ac3303696dd7d11 /src
parentdc3620af1b6a43ab30e6ce522321fc6c74008251 (diff)
downloademacs-2a1d8be0dc8ff03732c66150b2732cf6db72b3bc.tar.gz
emacs-2a1d8be0dc8ff03732c66150b2732cf6db72b3bc.zip
(insert_from_string_1, replace_range):
Use STRING_MULTIBYTE to determine whether string is multibyte.
Diffstat (limited to 'src')
-rw-r--r--src/insdel.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 55f8b61e868..63b284eb003 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1089,7 +1089,7 @@ insert_from_string_1 (string, pos, pos_byte, nchars, nbytes,
1089 1089
1090 if (NILP (current_buffer->enable_multibyte_characters)) 1090 if (NILP (current_buffer->enable_multibyte_characters))
1091 outgoing_nbytes = nchars; 1091 outgoing_nbytes = nchars;
1092 else if (nchars == nbytes) 1092 else if (! STRING_MULTIBYTE (string))
1093 outgoing_nbytes 1093 outgoing_nbytes
1094 = count_size_as_multibyte (&XSTRING (string)->data[pos_byte], 1094 = count_size_as_multibyte (&XSTRING (string)->data[pos_byte],
1095 nbytes); 1095 nbytes);
@@ -1111,11 +1111,7 @@ insert_from_string_1 (string, pos, pos_byte, nchars, nbytes,
1111 /* Copy the string text into the buffer, perhaps converting 1111 /* Copy the string text into the buffer, perhaps converting
1112 between single-byte and multibyte. */ 1112 between single-byte and multibyte. */
1113 copy_text (XSTRING (string)->data + pos_byte, GPT_ADDR, nbytes, 1113 copy_text (XSTRING (string)->data + pos_byte, GPT_ADDR, nbytes,
1114 /* If these are equal, it is a single-byte string. 1114 STRING_MULTIBYTE (string),
1115 Its chars are either ASCII, in which case copy_text
1116 won't change it, or single-byte non-ASCII chars,
1117 that need to be changed. */
1118 nchars != nbytes,
1119 ! NILP (current_buffer->enable_multibyte_characters)); 1115 ! NILP (current_buffer->enable_multibyte_characters));
1120 1116
1121 /* We have copied text into the gap, but we have not altered 1117 /* We have copied text into the gap, but we have not altered
@@ -1539,7 +1535,7 @@ replace_range (from, to, new, prepare, inherit, nomarkers)
1539 1535
1540 if (NILP (current_buffer->enable_multibyte_characters)) 1536 if (NILP (current_buffer->enable_multibyte_characters))
1541 outgoing_insbytes = inschars; 1537 outgoing_insbytes = inschars;
1542 else if (inschars == insbytes) 1538 else if (! STRING_MULTIBYTE (new))
1543 outgoing_insbytes 1539 outgoing_insbytes
1544 = count_size_as_multibyte (XSTRING (new)->data, insbytes); 1540 = count_size_as_multibyte (XSTRING (new)->data, insbytes);
1545 1541
@@ -1590,11 +1586,7 @@ replace_range (from, to, new, prepare, inherit, nomarkers)
1590 /* Copy the string text into the buffer, perhaps converting 1586 /* Copy the string text into the buffer, perhaps converting
1591 between single-byte and multibyte. */ 1587 between single-byte and multibyte. */
1592 copy_text (XSTRING (new)->data, GPT_ADDR, insbytes, 1588 copy_text (XSTRING (new)->data, GPT_ADDR, insbytes,
1593 /* If these are equal, it is a single-byte string. 1589 STRING_MULTIBYTE (new),
1594 Its chars are either ASCII, in which case copy_text
1595 won't change it, or single-byte non-ASCII chars,
1596 that need to be changed. */
1597 inschars != insbytes,
1598 ! NILP (current_buffer->enable_multibyte_characters)); 1590 ! NILP (current_buffer->enable_multibyte_characters));
1599 1591
1600 /* We have copied text into the gap, but we have not altered 1592 /* We have copied text into the gap, but we have not altered