aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1998-03-03 01:29:16 +0000
committerKenichi Handa1998-03-03 01:29:16 +0000
commit59a52d5000d01d51dd42297c1b6415c54400cda3 (patch)
tree8d4e4f969395972f78fb2fe316ff349705e40021 /src
parent11218c687b453aff6e332bde3e98cdb1f5bdbf6c (diff)
downloademacs-59a52d5000d01d51dd42297c1b6415c54400cda3.tar.gz
emacs-59a52d5000d01d51dd42297c1b6415c54400cda3.zip
(DEFAULT_NONASCII_INSERT_OFFSET): Macro definition is
moved to charset.h. (copy_text): Don't convert codes in the range 0200..0237 to multibyte characters. For codes in the range 0240..0377, use unibyte_char_to_multibyte. (count_size_as_multibyte): Likewise. (adjust_before_replace): Comment fixed.
Diffstat (limited to 'src')
-rw-r--r--src/insdel.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 5fc6613b834..54d1cf1606e 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -62,8 +62,6 @@ Lisp_Object combine_after_change_list;
62 62
63/* Buffer which combine_after_change_list is about. */ 63/* Buffer which combine_after_change_list is about. */
64Lisp_Object combine_after_change_buffer; 64Lisp_Object combine_after_change_buffer;
65
66#define DEFAULT_NONASCII_INSERT_OFFSET 0x800
67 65
68/* Move gap to position CHARPOS. 66/* Move gap to position CHARPOS.
69 Note that this can quit! */ 67 Note that this can quit! */
@@ -592,15 +590,9 @@ copy_text (from_addr, to_addr, nbytes,
592 unsigned char workbuf[4], *str; 590 unsigned char workbuf[4], *str;
593 int len; 591 int len;
594 592
595 if (c >= 0200 && c < 0400) 593 if (c >= 0240 && c < 0400)
596 { 594 {
597 if (! NILP (Vnonascii_translate_table)) 595 c = unibyte_char_to_multibyte (c);
598 c = XINT (Faref (Vnonascii_translate_table, make_number (c)));
599 else if (nonascii_insert_offset > 0)
600 c += nonascii_insert_offset;
601 else
602 c += DEFAULT_NONASCII_INSERT_OFFSET;
603
604 len = CHAR_STRING (c, workbuf, str); 596 len = CHAR_STRING (c, workbuf, str);
605 bcopy (str, to_addr, len); 597 bcopy (str, to_addr, len);
606 to_addr += len; 598 to_addr += len;
@@ -629,16 +621,14 @@ count_size_as_multibyte (ptr, nbytes)
629 for (i = 0; i < nbytes; i++) 621 for (i = 0; i < nbytes; i++)
630 { 622 {
631 unsigned int c = *ptr++; 623 unsigned int c = *ptr++;
632 if (c >= 0200 && c < 0400) 624
625 if (c < 0240)
626 outgoing_nbytes++;
627 else
633 { 628 {
634 if (! NILP (Vnonascii_translate_table)) 629 c = unibyte_char_to_multibyte (c);
635 c = XINT (Faref (Vnonascii_translate_table, make_number (c))); 630 outgoing_nbytes += XINT (Fchar_bytes (make_number (c)));
636 else if (nonascii_insert_offset > 0)
637 c += nonascii_insert_offset;
638 else
639 c += DEFAULT_NONASCII_INSERT_OFFSET;
640 } 631 }
641 outgoing_nbytes += XINT (Fchar_bytes (make_number (c)));
642 } 632 }
643 633
644 return outgoing_nbytes; 634 return outgoing_nbytes;
@@ -1077,10 +1067,9 @@ insert_from_buffer_1 (buf, from, nchars, inherit)
1077} 1067}
1078 1068
1079/* This function should be called after moving gap to FROM and before 1069/* This function should be called after moving gap to FROM and before
1080 altering LEN chars of text starting from FROM. This adjusts 1070 altering text between FROM and TO. This adjusts various position
1081 various position keepers and markers and as if the text is deleted. 1071 keepers and markers as if the text is deleted. Don't forget to
1082 Don't forget to call adjust_after_replace after you actually alter 1072 call adjust_after_replace after you actually alter the text. */
1083 the text. */
1084 1073
1085void 1074void
1086adjust_before_replace (from, from_byte, to, to_byte) 1075adjust_before_replace (from, from_byte, to, to_byte)