1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-23 18:47:57 +00:00
Commit Graph

120 Commits

Author SHA1 Message Date
Kenichi Handa
b80f1b20d3 (replace_range): Fix previous change. 1998-10-31 05:24:11 +00:00
Kenichi Handa
039af53ac4 (byte_combining_error): New function.
(CHECK_BYTE_COMBINING_FOR_INSERT): Call byte_combining_error.
(insert_from_string_1): Set *(GPT_ADDR) to 0 before calling
CHECK_BYTE_COMBINING_FOR_INSERT.
(insert_from_buffer_1): Likewise.
(adjust_after_replace): Check the posibility of inhibitted byte
combining correctly.
(replace_range): Before signaling an error for inhibitted byte
combining, recover the buffer in a safe state.
(del_range_2): Check the posibility of inhibitted byte combining
correctly.
1998-10-31 05:12:07 +00:00
Kenichi Handa
9f3ede3ccc (check_markers): Check if markers are at character
boundry.
(adjust_markers_for_insert): Fix previous change.
(count_combining_before): Don't limit the check at BEGV.
(count_combining_after): Don't limit the check at ZV.
(CHECK_BYTE_COMBINING_FOR_INSERT): New macro.
(insert_1_both): Call CHECK_BYTE_COMBINING_FOR_INSERT.
(insert_from_string_1): Likewise.
(insert_from_buffer_1): Likewise.
(adjust_after_replace): Inhibit bytes combined across region
boundary.  Update end_unchanged correctly.
(replace_range): Call CHECK_BYTE_COMBINING_FOR_INSERT.  Update
end_unchanged correctly.
(del_range_2): Inhibit bytes combined across region boundary.
Update end_unchanged correctly.
1998-10-28 07:52:13 +00:00
Kenichi Handa
f6ecdae5b2 (adjust_after_replace): Correctly handle the case that
both byte combining before and byte combining after happen.
(replace_range): Likewise.
1998-10-27 03:54:13 +00:00
Kenichi Handa
828f1ed318 (adjust_markers_for_insert): Adjust markers by taking
combined_before_bytes and combined_after_bytes into account.
(count_combining_after): Handle the case that LENGTH is zero.
(adjust_after_replace): Record deletion at correct buffer
position.  Handle the case that LEN is zero.
(replace_range): Record deletion at correct buffer position.
(del_range_2): Call adjust_makers_for_replace to adjust makers for
combined bytes.
1998-10-24 01:17:09 +00:00
Kenichi Handa
3019692c38 (adjust_markers_for_combining): This function deleted.
(adjust_markers_for_replace): Correctly adjust marker positions.
Don't record these adjustment because they were recorded already.
(combine_bytes): Don't adjust markers here.
1998-10-14 07:17:22 +00:00
Kenichi Handa
fd16a4c6d8 (signal_before_change): If inhibit_modification_hooks
is nonzero, do nothing.
(signal_after_change): Likewise.
1998-10-08 06:45:36 +00:00
Kenichi Handa
d7af002f65 (adjust_after_replace): Don't delete text properties here. 1998-09-28 11:52:53 +00:00
Kenichi Handa
23b20a7066 (adjust_markers_for_replace): Don't adjust a byte
position if it is FROM.
(adjust_markers_for_combining): New function.
(combine_bytes): Call adjust_markers_for_combining instead of
adjust_markers_for_replace.
(adjust_after_replace): Record deletion of combining after bytes
with the correct position.  Don't add combining bytes to the args
given to adjust_point.  Handle correctly the case that there are
both before and after combining bytes.
(replace_range): Likewise.  Record the actual deletion after
recoding deletions of combining bytes.
1998-09-16 07:21:31 +00:00
Kenichi Handa
8bedbe9dc2 (adjust_after_replace): Don't add combining bytes to
the args given to adjust_point.  Handle correctly the case that
there are both before and after combining bytes.
(replace_range): Likewise.
1998-09-08 02:01:59 +00:00
Kenichi Handa
b57a7b0bf4 (count_combining_after): Check also preceding bytes at
POS if all characters in STRING are not character head.
1998-09-07 13:39:15 +00:00
Kenichi Handa
3b0800187d (copy_text): If Vnonascii_translation_table is non-nil, try
to convert a character less than 160 to multibyte.
(count_size_as_multibyte): Likewise.
1998-08-31 03:50:17 +00:00
Kenichi Handa
4a7cf15f47 (adjust_after_replace): Fix the code to recode undo
information for the case that `before combining' happens.  Remove
text properties which are added to the new text by
offset_intervals.
1998-08-28 12:33:52 +00:00
Kenichi Handa
643044ebfd (count_size_as_multibyte): Use macro CHAR_BYTES instead of Fchar_bytes. 1998-08-28 12:22:39 +00:00
Richard M. Stallman
60aa777aec (replace_range): Rename NOMARKERS arg to MARKERS. 1998-08-18 07:00:00 +00:00
Kenichi Handa
4ec3678010 (copy_text): Fix previous change, call
multibyte_char_to_unibyte.
1998-08-15 01:28:14 +00:00
Richard M. Stallman
255c7daeba (replace_range): Don't assume PT is at the place
where the change is being done.
1998-08-03 22:25:54 +00:00
Kenichi Handa
f44cbcd8dc (copy_text): In multibyte to unibyte conversion, take
nonascii-translation-table and nonascii-insert-offset into
account.
1998-08-02 01:06:57 +00:00
Richard M. Stallman
0aa8c4b24d (insert_1_both, insert_from_string_1, replace_range)
(insert_from_buffer_1, adjust_before_replace, adjust_after_replace):
Don't copy text being deleted, if undo is disabled.
1998-05-16 20:34:59 +00:00
Richard M. Stallman
35d6372510 (insert_1_both): Call prepare_to_modify_buffer before moving or making gap.
(insert_from_string_1): Don't check max buffer size here.
1998-04-29 00:20:14 +00:00
Richard M. Stallman
62b82678be (insert_from_string, insert_from_string_before_markers):
Don't special case LENGTH = 0.
(insert_from_buffer): Likewise.
1998-04-25 23:32:56 +00:00
Richard M. Stallman
7e79b8e08d (copy_text): Count down bytes_left properly
in multibyte to unibyte case.
1998-04-20 07:08:40 +00:00
Andreas Schwab
d6b81c0f2f (signal_after_change): Fix mixing of Lisp_Object and
int.
1998-04-14 13:01:05 +00:00
Andreas Schwab
dfcf069d56 Fix -Wimplicit warnings. 1998-04-14 12:25:56 +00:00
Kenichi Handa
652838b531 (adjust_markers_for_replace): New function.
(adjust_after_replace): Arguments changed.  Call
adjust_markers_for_replace if this function is called after
replacement.
(adjust_after_insert): New function.
1998-03-30 06:00:54 +00:00
Richard M. Stallman
60ea60525e (check_markers_debug_flag): New variable.
(syms_of_insdel): Set up Lisp var.
(CHECK_MARKERS): New macro.  Use it everywhere
instead of calling check_markers directly.
It tests check_markers_debug_flag.
1998-03-28 21:52:10 +00:00
Kenichi Handa
242beafec7 (del_range_2): Move gap again to a proper place just
after calling make_buffer_string_both.
1998-03-24 05:41:38 +00:00
Richard M. Stallman
2a1d8be0dc (insert_from_string_1, replace_range):
Use STRING_MULTIBYTE to determine whether string is multibyte.
1998-03-21 17:48:54 +00:00
Richard M. Stallman
fc932ac6c7 Use STRING_BYTES and SET_STRING_BYTES. 1998-03-21 07:06:14 +00:00
Richard M. Stallman
2db5082ff4 (replace_range): New arg NOMARKERS. 1998-03-21 05:48:03 +00:00
Richard M. Stallman
628cea90f1 (insert_1_both, insert_from_string_1, insert_from_buffer_1):
(adjust_before_replace, adjust_after_replace, replace_range):
(del_range_2): Call record_delete the new way.
Use make_buffer_string_both to make the string to pass.
1998-03-21 03:57:35 +00:00
Richard M. Stallman
7cc3983fcb (del_range_2): Use adjust_markers_for_record_delete.
(adjust_markers_for_delete): Delete unused local coming_gap_size.
(adjust_markers_for_record_delete): New function.
(insert_1_both, insert_from_string_1, insert_from_buffer_1)
(adjust_after_replace, replace_range):
Use adjust_markers_for_record_delete.
1998-03-20 06:10:36 +00:00
Kenichi Handa
e3a87305b8 (ADJUST_CHAR_POS): New macro.
(combine_bytes): Use the macro ADJUST_CHAR_POS.
(adjust_after_replace): New arg REPLACE.  If it is zero, give LEN
as the arg LENGTH to offset_intervals.
(del_range_2): Give correct args to count_combining_before and
combine_bytes.  Adjust the gap position after record_delete if
necessary.  Give character position to adjust_overlays_for_delete.
1998-03-16 05:51:07 +00:00
Richard M. Stallman
e0c0ed58af (insert_1_both, insert_from_string_1, insert_from_buffer_1)
(adjust_after_replace, replace_range):
Account for combining bytes in args to record_insert.
(del_range_2): Make undo records for combining bytes.
Put second call to move_gap_both before setting beg_unchanged.
1998-03-14 21:54:42 +00:00
Kenichi Handa
61415a2589 (adjust_before_replace): Call
adjust_overlays_for_delete.
(adjust_after_replace): Delete args COMBINED_BEFORE_BYTES and
COMBINED_AFTER_BYTES.  This makes the newly generated text
following GPT_ADDR a buffer contents.
1998-03-12 00:42:35 +00:00
Richard M. Stallman
1f90a790f5 (combine_bytes): New function.
(insert_1_both, insert_from_string_1, insert_from_buffer_1):
Simplify greatly by using combine_bytes near the end
to handle all aspects of combining except for undo-recording.
This means most of the code deals with the text as if there were
no combining.
(replace_range): Likewise.  Also handle unibyte-multibyte conversion
as in insert_from_string_1.
(del_range_2): Handle combining of character before the deletion
with strays after the deletion.
(adjust_markers_for_delete): Delete debugging code for Z == Z_BYTE.
(adjust_markers_for_insert): Move Z == Z_BYTE debugging code
to before we relocate the marker.
1998-03-11 22:08:24 +00:00
Richard M. Stallman
ce97a2d7ed (adjust_markers_for_insert): Don't leave a marker within
the combined_after_bytes.  Use DEC than INC when leaving
a marker before the insertion.
(count_combining_before): Return number of bytes from start
of insertion that will combine.
(insert_1_both): Compensate for change in count_combining_before.
Delete intervals for the combined_after_bytes.
Compensate for that when updating other intervals.
(insert_from_buffer_1, replace_range): Likewise.
(adjust_after_replace): Likewise.
(insert_from_string_1): Likewise.  Also handle intervals
for inserting just part of string.
1998-03-11 00:47:48 +00:00
Richard M. Stallman
93b882e857 (insert_1_both, insert_from_string_1, insert_from_buffer_1):
Count all of combined_after_bytes, not just 1, when correcting
nchars, and in related places.
(adjust_after_replace, replace_range): Likewise.
1998-03-10 23:50:30 +00:00
Richard M. Stallman
432f78d25b (adjust_markers_for_insert):
New args COMBINED_AFTER_BYTES, COMBINED_BEFORE_BYTES.  Calls changed.
(insert_1): Call insert_1_both.
(count_combining_before): New function.
(count_combining_after): New function.
(insert_1_both, insert_from_string_1): Handle bytes that combine
with chars adjacent to the inserted text.
(insert_from_buffer_1, replace_range): Likewise.
(adjust_after_replace): New args COMBINED_BEFORE_BYTES, COMBINED_AFTER_BYTES.
1998-03-09 23:22:44 +00:00
Kenichi Handa
5740418892 (insert_1_both): If enable-multibyte-characters is nil,
insert each byte as one character.
1998-03-03 07:18:46 +00:00
Kenichi Handa
59a52d5000 (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.
1998-03-03 01:29:16 +00:00
Karl Heuer
a66afea01c (del_range_2): Reorder args. All callers changed. 1998-02-27 22:09:33 +00:00
Karl Heuer
353800c79a (del_range_both): Reorder args. All callers changed. 1998-02-25 23:18:15 +00:00
Kenichi Handa
2d9eea4477 (adjust_before_replace): Comment added.
(adjust_after_replace): Comment added.  Give correct args to
adjust_point.  Don't call signal_after_change here.
1998-02-20 01:40:47 +00:00
Richard M. Stallman
2c3af3383d (copy_text, count_size_as_multibyte): Use Vnonascii_translate_table. 1998-02-12 05:19:41 +00:00
Kenichi Handa
cb97b980dd (copy_text): When copying from multibyte to unibyte, do
not alter ASCII characters.
1998-02-04 11:23:28 +00:00
Kenichi Handa
1e9c7b7d91 (adjust_before_replace, adjust_after_replace): New
functions.
1998-01-22 01:26:45 +00:00
Richard M. Stallman
4a2f9c6aef Update copyright year. 1998-01-21 23:32:12 +00:00
Kenichi Handa
7792090e89 (insert_from_string_1): Decrement GAP_SIZE by
outgoing_nbytes.
1998-01-12 05:49:45 +00:00
Richard M. Stallman
2b08380873 (count_size_as_multibyte): New function.
(insert_from_string_1, insert_from_buffer_1): Use it.
(copy_text): New function.
(insert_from_buffer_1): Call copy_text to convert between
single-byte and multibyte text.
(insert_from_string_1): Likewise.
(insert_1_both): New function.
(insert_from_string): New args POS_BYTE, LENGTH.
(insert_from_string_before_markers):
(insert_from_string_1): New arg POS_BYTE.  Swap args NCHARS, NBYTES.
Don't fail to use POS_BYTE!
(insert_from_buffer_1): Get both inschars and insbytes from NEW.
1998-01-09 22:46:07 +00:00