summaryrefslogtreecommitdiff
path: root/src/insdel.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-03-21 17:48:54 +0000
committerRichard M. Stallman <rms@gnu.org>1998-03-21 17:48:54 +0000
commit2a1d8be0dc8ff03732c66150b2732cf6db72b3bc (patch)
tree538e12b2484c3cc90110b37e9ac3303696dd7d11 /src/insdel.c
parentdc3620af1b6a43ab30e6ce522321fc6c74008251 (diff)
downloademacs-2a1d8be0dc8ff03732c66150b2732cf6db72b3bc.tar.gz
(insert_from_string_1, replace_range):
Use STRING_MULTIBYTE to determine whether string is multibyte.
Diffstat (limited to 'src/insdel.c')
-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,
if (NILP (current_buffer->enable_multibyte_characters))
outgoing_nbytes = nchars;
- else if (nchars == nbytes)
+ else if (! STRING_MULTIBYTE (string))
outgoing_nbytes
= count_size_as_multibyte (&XSTRING (string)->data[pos_byte],
nbytes);
@@ -1111,11 +1111,7 @@ insert_from_string_1 (string, pos, pos_byte, nchars, nbytes,
/* Copy the string text into the buffer, perhaps converting
between single-byte and multibyte. */
copy_text (XSTRING (string)->data + pos_byte, GPT_ADDR, nbytes,
- /* If these are equal, it is a single-byte string.
- Its chars are either ASCII, in which case copy_text
- won't change it, or single-byte non-ASCII chars,
- that need to be changed. */
- nchars != nbytes,
+ STRING_MULTIBYTE (string),
! NILP (current_buffer->enable_multibyte_characters));
/* We have copied text into the gap, but we have not altered
@@ -1539,7 +1535,7 @@ replace_range (from, to, new, prepare, inherit, nomarkers)
if (NILP (current_buffer->enable_multibyte_characters))
outgoing_insbytes = inschars;
- else if (inschars == insbytes)
+ else if (! STRING_MULTIBYTE (new))
outgoing_insbytes
= count_size_as_multibyte (XSTRING (new)->data, insbytes);
@@ -1590,11 +1586,7 @@ replace_range (from, to, new, prepare, inherit, nomarkers)
/* Copy the string text into the buffer, perhaps converting
between single-byte and multibyte. */
copy_text (XSTRING (new)->data, GPT_ADDR, insbytes,
- /* If these are equal, it is a single-byte string.
- Its chars are either ASCII, in which case copy_text
- won't change it, or single-byte non-ASCII chars,
- that need to be changed. */
- inschars != insbytes,
+ STRING_MULTIBYTE (new),
! NILP (current_buffer->enable_multibyte_characters));
/* We have copied text into the gap, but we have not altered