summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorGregory Heytings <gregory@heytings.org>2022-07-16 19:06:38 +0000
committerGregory Heytings <gregory@heytings.org>2022-07-16 21:13:33 +0200
commite7b5912b235936b304701ba6b1e808d9b197fd4f (patch)
tree78cfbd3ab9c032e45a6ba0f1e763807a01a9a3ec /src/buffer.h
parent9de00e5fda2e04316357bd8cf0d8094c63ff171b (diff)
downloademacs-e7b5912b235936b304701ba6b1e808d9b197fd4f.tar.gz
Improvements to long lines handling.
* src/buffer.h (struct buffer): New field 'long_line_optimizations_p'. * src/buffer.c (syms_of_buffer): New variable 'long-line-threshold'. (reset_buffer): Initialize the 'long_line_optimizations_p' field. (Fbuffer_swap_text): Handle it. * src/xdisp.c (redisplay_window): Set 'long_line_optimizations_p' when a buffer contains long lines. (init_iterator): Use 'long_line_optimizations_p'. (get_narrowed_begv): Update. (SET_WITH_NARROWED_BEGV): New macro. (unwind_narrowed_begv): New internal function used by the new macro. (back_to_previous_line_start, get_visually_first_element, move_it_vertically_backward): Use the new macro. * src/search.c (find_newline1): Make it externally visible. * src/lisp.h: Make 'find_newline1' externally visible. * src/dispextern.h (struct it): Update comment. Remove the 'WITH_NARROWED_BEGV' macro. * etc/NEWS: Mention the 'long-line-threshold' variable.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 135eaf72d30..09daa29992a 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -681,6 +681,10 @@ struct buffer
defined, as well as by with-temp-buffer, for example. */
bool_bf inhibit_buffer_hooks : 1;
+ /* Non-zero when the buffer contains long lines and specific
+ display optimizations must be used. */
+ bool_bf long_line_optimizations_p : 1;
+
/* List of overlays that end at or before the current center,
in order of end-position. */
struct Lisp_Overlay *overlays_before;