]> git.eshelyaron.com Git - emacs.git/commit
Improvements to long lines handling.
authorGregory Heytings <gregory@heytings.org>
Sat, 16 Jul 2022 19:06:38 +0000 (19:06 +0000)
committerGregory Heytings <gregory@heytings.org>
Sat, 16 Jul 2022 19:13:33 +0000 (21:13 +0200)
commite7b5912b235936b304701ba6b1e808d9b197fd4f
tree78cfbd3ab9c032e45a6ba0f1e763807a01a9a3ec
parent9de00e5fda2e04316357bd8cf0d8094c63ff171b
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.
etc/NEWS
src/buffer.c
src/buffer.h
src/dispextern.h
src/lisp.h
src/search.c
src/xdisp.c