diff options
| author | Gerd Möllmann | 2025-05-08 06:46:17 +0200 |
|---|---|---|
| committer | Gerd Möllmann | 2025-05-08 06:54:03 +0200 |
| commit | 38892c66d5467781b0ea512432fea6ecf637b4c7 (patch) | |
| tree | 2a8b7ff8e1c4e5147724440958219dd146ed377b /src/coding.c | |
| parent | 3aa95eddac15fb09cdd73dbfea305c1b00f1ac03 (diff) | |
| download | emacs-scratch/text-index.tar.gz emacs-scratch/text-index.zip | |
DO_MARKERS -> Pip's FOR_EACH_MARKERscratch/text-index
* src/marker-vector.h (DO_MARKERS_OF_VECTOR, DO_MARKERS): Remove.
(build_for_each_marker_data, next_marker_entry):
(FOR_EACH_MARKER_OF_VECTOR, FOR_EACH_MARKER): New.
* .clang-format (IndentPPDirectives): Add new FOR_EACH_ macros.
* src/alloc.c (unchain_dead_markers):
* src/buffer.c (Fkill_buffer, Fbuffer_swap_text)
(Fset_buffer_multibyte):
* src/coding.c (decode_coding_object, encode_coding_object):
* src/editfns.c (transpose_markers):
* src/marker-vector.c (check_marker_vector, marker_vector_reset)
(marker_vector_adjust_for_insert)
(marker_vector_adjust_for_replace):
* src/undo.c (record_marker_adjustments): Use FOR_EACH_MARKER.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/coding.c b/src/coding.c index f3dd2639e73..51c87fb3161 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -8118,14 +8118,13 @@ decode_coding_object (struct coding_system *coding, | |||
| 8118 | move_gap_both (from, from_byte); | 8118 | move_gap_both (from, from_byte); |
| 8119 | if (BASE_EQ (src_object, dst_object)) | 8119 | if (BASE_EQ (src_object, dst_object)) |
| 8120 | { | 8120 | { |
| 8121 | DO_MARKERS (current_buffer, tail) | 8121 | FOR_EACH_MARKER (current_buffer, tail) |
| 8122 | { | 8122 | { |
| 8123 | const ptrdiff_t charpos = marker_vector_charpos (tail); | 8123 | const ptrdiff_t charpos = marker_vector_charpos (tail); |
| 8124 | tail->need_adjustment | 8124 | tail->need_adjustment |
| 8125 | = charpos == (tail->insertion_type ? from : to); | 8125 | = charpos == (tail->insertion_type ? from : to); |
| 8126 | need_marker_adjustment |= tail->need_adjustment; | 8126 | need_marker_adjustment |= tail->need_adjustment; |
| 8127 | } | 8127 | } |
| 8128 | END_DO_MARKERS; | ||
| 8129 | saved_pt = PT, saved_pt_byte = PT_BYTE; | 8128 | saved_pt = PT, saved_pt_byte = PT_BYTE; |
| 8130 | TEMP_SET_PT_BOTH (from, from_byte); | 8129 | TEMP_SET_PT_BOTH (from, from_byte); |
| 8131 | current_buffer->text->inhibit_shrinking = true; | 8130 | current_buffer->text->inhibit_shrinking = true; |
| @@ -8250,7 +8249,7 @@ decode_coding_object (struct coding_system *coding, | |||
| 8250 | 8249 | ||
| 8251 | if (need_marker_adjustment) | 8250 | if (need_marker_adjustment) |
| 8252 | { | 8251 | { |
| 8253 | DO_MARKERS (current_buffer, tail) | 8252 | FOR_EACH_MARKER (current_buffer, tail) |
| 8254 | { | 8253 | { |
| 8255 | if (tail->need_adjustment) | 8254 | if (tail->need_adjustment) |
| 8256 | { | 8255 | { |
| @@ -8269,7 +8268,6 @@ decode_coding_object (struct coding_system *coding, | |||
| 8269 | } | 8268 | } |
| 8270 | } | 8269 | } |
| 8271 | } | 8270 | } |
| 8272 | END_DO_MARKERS; | ||
| 8273 | } | 8271 | } |
| 8274 | } | 8272 | } |
| 8275 | 8273 | ||
| @@ -8340,14 +8338,13 @@ encode_coding_object (struct coding_system *coding, | |||
| 8340 | if (BASE_EQ (src_object, dst_object) && BUFFERP (src_object)) | 8338 | if (BASE_EQ (src_object, dst_object) && BUFFERP (src_object)) |
| 8341 | { | 8339 | { |
| 8342 | same_buffer = true; | 8340 | same_buffer = true; |
| 8343 | DO_MARKERS (XBUFFER (src_object), tail) | 8341 | FOR_EACH_MARKER (XBUFFER (src_object), tail) |
| 8344 | { | 8342 | { |
| 8345 | const ptrdiff_t charpos = marker_vector_charpos (tail); | 8343 | const ptrdiff_t charpos = marker_vector_charpos (tail); |
| 8346 | tail->need_adjustment | 8344 | tail->need_adjustment |
| 8347 | = charpos == (tail->insertion_type ? from : to); | 8345 | = charpos == (tail->insertion_type ? from : to); |
| 8348 | need_marker_adjustment |= tail->need_adjustment; | 8346 | need_marker_adjustment |= tail->need_adjustment; |
| 8349 | } | 8347 | } |
| 8350 | END_DO_MARKERS; | ||
| 8351 | } | 8348 | } |
| 8352 | 8349 | ||
| 8353 | if (! NILP (CODING_ATTR_PRE_WRITE (attrs))) | 8350 | if (! NILP (CODING_ATTR_PRE_WRITE (attrs))) |
| @@ -8505,7 +8502,7 @@ encode_coding_object (struct coding_system *coding, | |||
| 8505 | 8502 | ||
| 8506 | if (need_marker_adjustment) | 8503 | if (need_marker_adjustment) |
| 8507 | { | 8504 | { |
| 8508 | DO_MARKERS (current_buffer, tail) | 8505 | FOR_EACH_MARKER (current_buffer, tail) |
| 8509 | { | 8506 | { |
| 8510 | if (tail->need_adjustment) | 8507 | if (tail->need_adjustment) |
| 8511 | { | 8508 | { |
| @@ -8524,7 +8521,6 @@ encode_coding_object (struct coding_system *coding, | |||
| 8524 | } | 8521 | } |
| 8525 | } | 8522 | } |
| 8526 | } | 8523 | } |
| 8527 | END_DO_MARKERS; | ||
| 8528 | } | 8524 | } |
| 8529 | } | 8525 | } |
| 8530 | 8526 | ||