diff options
| author | Gregory Heytings | 2022-12-10 23:04:10 +0000 |
|---|---|---|
| committer | Gregory Heytings | 2022-12-11 00:16:27 +0100 |
| commit | 7d787564c08351b275e8f729e8e9f1ec2ae8fe04 (patch) | |
| tree | 4c803b455311e549bd8d6b5d8ddeab768af91b77 /src | |
| parent | 118465f6fed8bf490cc69634b96d1ffa721abb7b (diff) | |
| download | emacs-7d787564c08351b275e8f729e8e9f1ec2ae8fe04.tar.gz emacs-7d787564c08351b275e8f729e8e9f1ec2ae8fe04.zip | |
Actually improve detection of long lines
* src/xdisp.c (redisplay_window): Update condition.
* src/xdisp.c (mark_window_display_accurate_1):
* src/pdumper.c (dump_buffer):
* src/buffer.h (BUF_CHARS_UNCHANGED_MODIFIED):
(struct buffer_text):
* src/buffer.c (Fget_buffer_create):
Revert 1c837c42c2, which was misguided.
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.c | 1 | ||||
| -rw-r--r-- | src/buffer.h | 11 | ||||
| -rw-r--r-- | src/pdumper.c | 1 | ||||
| -rw-r--r-- | src/xdisp.c | 3 |
4 files changed, 1 insertions, 15 deletions
diff --git a/src/buffer.c b/src/buffer.c index 71be7ed9e13..69f27c9f476 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -604,7 +604,6 @@ even if it is dead. The return value is never nil. */) | |||
| 604 | set_buffer_intervals (b, NULL); | 604 | set_buffer_intervals (b, NULL); |
| 605 | BUF_UNCHANGED_MODIFIED (b) = 1; | 605 | BUF_UNCHANGED_MODIFIED (b) = 1; |
| 606 | BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1; | 606 | BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1; |
| 607 | BUF_CHARS_UNCHANGED_MODIFIED (b) = 1; | ||
| 608 | BUF_END_UNCHANGED (b) = 0; | 607 | BUF_END_UNCHANGED (b) = 0; |
| 609 | BUF_BEG_UNCHANGED (b) = 0; | 608 | BUF_BEG_UNCHANGED (b) = 0; |
| 610 | *(BUF_GPT_ADDR (b)) = *(BUF_Z_ADDR (b)) = 0; /* Put an anchor '\0'. */ | 609 | *(BUF_GPT_ADDR (b)) = *(BUF_Z_ADDR (b)) = 0; /* Put an anchor '\0'. */ |
diff --git a/src/buffer.h b/src/buffer.h index dded0cd98c1..80b3fd81e09 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -149,18 +149,12 @@ enum { BEG = 1, BEG_BYTE = BEG }; | |||
| 149 | #define BUF_BEG_UNCHANGED(buf) ((buf)->text->beg_unchanged) | 149 | #define BUF_BEG_UNCHANGED(buf) ((buf)->text->beg_unchanged) |
| 150 | #define BUF_END_UNCHANGED(buf) ((buf)->text->end_unchanged) | 150 | #define BUF_END_UNCHANGED(buf) ((buf)->text->end_unchanged) |
| 151 | 151 | ||
| 152 | #define BUF_CHARS_UNCHANGED_MODIFIED(buf) \ | ||
| 153 | ((buf)->text->chars_unchanged_modified) | ||
| 154 | |||
| 155 | #define UNCHANGED_MODIFIED \ | 152 | #define UNCHANGED_MODIFIED \ |
| 156 | BUF_UNCHANGED_MODIFIED (current_buffer) | 153 | BUF_UNCHANGED_MODIFIED (current_buffer) |
| 157 | #define OVERLAY_UNCHANGED_MODIFIED \ | 154 | #define OVERLAY_UNCHANGED_MODIFIED \ |
| 158 | BUF_OVERLAY_UNCHANGED_MODIFIED (current_buffer) | 155 | BUF_OVERLAY_UNCHANGED_MODIFIED (current_buffer) |
| 159 | #define BEG_UNCHANGED BUF_BEG_UNCHANGED (current_buffer) | 156 | #define BEG_UNCHANGED BUF_BEG_UNCHANGED (current_buffer) |
| 160 | #define END_UNCHANGED BUF_END_UNCHANGED (current_buffer) | 157 | #define END_UNCHANGED BUF_END_UNCHANGED (current_buffer) |
| 161 | |||
| 162 | #define CHARS_UNCHANGED_MODIFIED \ | ||
| 163 | BUF_CHARS_UNCHANGED_MODIFIED (current_buffer) | ||
| 164 | 158 | ||
| 165 | /* Functions to set PT in the current buffer, or another buffer. */ | 159 | /* Functions to set PT in the current buffer, or another buffer. */ |
| 166 | 160 | ||
| @@ -274,11 +268,6 @@ struct buffer_text | |||
| 274 | end_unchanged contain no useful information. */ | 268 | end_unchanged contain no useful information. */ |
| 275 | modiff_count overlay_unchanged_modified; | 269 | modiff_count overlay_unchanged_modified; |
| 276 | 270 | ||
| 277 | /* CHARS_MODIFF as of last redisplay that finished. It's used | ||
| 278 | when we only care about changes in actual buffer text, not in | ||
| 279 | any other kind of changes, like properties etc. */ | ||
| 280 | modiff_count chars_unchanged_modified; | ||
| 281 | |||
| 282 | /* Properties of this buffer's text. */ | 271 | /* Properties of this buffer's text. */ |
| 283 | INTERVAL intervals; | 272 | INTERVAL intervals; |
| 284 | 273 | ||
diff --git a/src/pdumper.c b/src/pdumper.c index fedcd3e4044..263343f60be 100644 --- a/src/pdumper.c +++ b/src/pdumper.c | |||
| @@ -2811,7 +2811,6 @@ dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer) | |||
| 2811 | DUMP_FIELD_COPY (out, buffer, own_text.end_unchanged); | 2811 | DUMP_FIELD_COPY (out, buffer, own_text.end_unchanged); |
| 2812 | DUMP_FIELD_COPY (out, buffer, own_text.unchanged_modified); | 2812 | DUMP_FIELD_COPY (out, buffer, own_text.unchanged_modified); |
| 2813 | DUMP_FIELD_COPY (out, buffer, own_text.overlay_unchanged_modified); | 2813 | DUMP_FIELD_COPY (out, buffer, own_text.overlay_unchanged_modified); |
| 2814 | DUMP_FIELD_COPY (out, buffer, own_text.chars_unchanged_modified); | ||
| 2815 | if (buffer->own_text.intervals) | 2814 | if (buffer->own_text.intervals) |
| 2816 | dump_field_fixup_later (ctx, out, buffer, &buffer->own_text.intervals); | 2815 | dump_field_fixup_later (ctx, out, buffer, &buffer->own_text.intervals); |
| 2817 | dump_field_lv_rawptr (ctx, out, buffer, &buffer->own_text.markers, | 2816 | dump_field_lv_rawptr (ctx, out, buffer, &buffer->own_text.markers, |
diff --git a/src/xdisp.c b/src/xdisp.c index 255851b9213..d14cd468191 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -17264,7 +17264,6 @@ mark_window_display_accurate_1 (struct window *w, bool accurate_p) | |||
| 17264 | 17264 | ||
| 17265 | BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b); | 17265 | BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b); |
| 17266 | BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); | 17266 | BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); |
| 17267 | BUF_CHARS_UNCHANGED_MODIFIED (b) = BUF_CHARS_MODIFF (b); | ||
| 17268 | BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b); | 17267 | BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b); |
| 17269 | BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); | 17268 | BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); |
| 17270 | 17269 | ||
| @@ -19535,7 +19534,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) | |||
| 19535 | /* Check whether the buffer to be displayed contains long lines. */ | 19534 | /* Check whether the buffer to be displayed contains long lines. */ |
| 19536 | if (!NILP (Vlong_line_threshold) | 19535 | if (!NILP (Vlong_line_threshold) |
| 19537 | && !current_buffer->long_line_optimizations_p | 19536 | && !current_buffer->long_line_optimizations_p |
| 19538 | && (CHARS_MODIFF - CHARS_UNCHANGED_MODIFIED > 8 | 19537 | && (CHARS_MODIFF - UNCHANGED_MODIFIED > 8 |
| 19539 | || current_buffer->clip_changed)) | 19538 | || current_buffer->clip_changed)) |
| 19540 | { | 19539 | { |
| 19541 | ptrdiff_t cur, next, found, max = 0, threshold; | 19540 | ptrdiff_t cur, next, found, max = 0, threshold; |