From 7d787564c08351b275e8f729e8e9f1ec2ae8fe04 Mon Sep 17 00:00:00 2001 From: Gregory Heytings Date: Sat, 10 Dec 2022 23:04:10 +0000 Subject: [PATCH] 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. --- src/buffer.c | 1 - src/buffer.h | 11 ----------- src/pdumper.c | 1 - src/xdisp.c | 3 +-- 4 files changed, 1 insertion(+), 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. */) set_buffer_intervals (b, NULL); BUF_UNCHANGED_MODIFIED (b) = 1; BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1; - BUF_CHARS_UNCHANGED_MODIFIED (b) = 1; BUF_END_UNCHANGED (b) = 0; BUF_BEG_UNCHANGED (b) = 0; *(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 }; #define BUF_BEG_UNCHANGED(buf) ((buf)->text->beg_unchanged) #define BUF_END_UNCHANGED(buf) ((buf)->text->end_unchanged) -#define BUF_CHARS_UNCHANGED_MODIFIED(buf) \ - ((buf)->text->chars_unchanged_modified) - #define UNCHANGED_MODIFIED \ BUF_UNCHANGED_MODIFIED (current_buffer) #define OVERLAY_UNCHANGED_MODIFIED \ BUF_OVERLAY_UNCHANGED_MODIFIED (current_buffer) #define BEG_UNCHANGED BUF_BEG_UNCHANGED (current_buffer) #define END_UNCHANGED BUF_END_UNCHANGED (current_buffer) - -#define CHARS_UNCHANGED_MODIFIED \ - BUF_CHARS_UNCHANGED_MODIFIED (current_buffer) /* Functions to set PT in the current buffer, or another buffer. */ @@ -274,11 +268,6 @@ struct buffer_text end_unchanged contain no useful information. */ modiff_count overlay_unchanged_modified; - /* CHARS_MODIFF as of last redisplay that finished. It's used - when we only care about changes in actual buffer text, not in - any other kind of changes, like properties etc. */ - modiff_count chars_unchanged_modified; - /* Properties of this buffer's text. */ INTERVAL intervals; 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) DUMP_FIELD_COPY (out, buffer, own_text.end_unchanged); DUMP_FIELD_COPY (out, buffer, own_text.unchanged_modified); DUMP_FIELD_COPY (out, buffer, own_text.overlay_unchanged_modified); - DUMP_FIELD_COPY (out, buffer, own_text.chars_unchanged_modified); if (buffer->own_text.intervals) dump_field_fixup_later (ctx, out, buffer, &buffer->own_text.intervals); 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) BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b); BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); - BUF_CHARS_UNCHANGED_MODIFIED (b) = BUF_CHARS_MODIFF (b); BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b); BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); @@ -19535,7 +19534,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) /* Check whether the buffer to be displayed contains long lines. */ if (!NILP (Vlong_line_threshold) && !current_buffer->long_line_optimizations_p - && (CHARS_MODIFF - CHARS_UNCHANGED_MODIFIED > 8 + && (CHARS_MODIFF - UNCHANGED_MODIFIED > 8 || current_buffer->clip_changed)) { ptrdiff_t cur, next, found, max = 0, threshold; -- 2.39.2