diff options
| author | Eli Zaretskii | 2022-08-13 16:59:22 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2022-08-13 16:59:22 +0300 |
| commit | 94c10c426e305037126cf75cc5cf23c9f8df4664 (patch) | |
| tree | 25d2ac366fd51f72c9af79ede798a867c0c832ef /src/buffer.c | |
| parent | 0ab572d5c991dee4818d364a65e004d20f1f45a1 (diff) | |
| download | emacs-94c10c426e305037126cf75cc5cf23c9f8df4664.tar.gz emacs-94c10c426e305037126cf75cc5cf23c9f8df4664.zip | |
Speed up display of long lines under 'truncate-lines'
* src/xdisp.c (partial_line_height): Return zero for long and
truncated lines.
(fast_move_it_horizontally): New function.
(hscroll_window_tree, display_line): Use
'fast_move_it_horizontally' in preference to
'move_it_in_display_line_to', when dealing with long and truncated
lines.
(redisplay_internal): Optimize "optimization 3" for long and
truncated lines.
* src/buffer.c (syms_of_buffer) <large-hscroll-threshold>: New
variable.
* etc/NEWS: Announce 'large-hscroll-threshold'.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c index e5601af5051..6ab516d5f51 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -6442,6 +6442,24 @@ If nil, these display shortcuts will always remain disabled. | |||
| 6442 | There is no reason to change that value except for debugging purposes. */); | 6442 | There is no reason to change that value except for debugging purposes. */); |
| 6443 | XSETFASTINT (Vlong_line_threshold, 10000); | 6443 | XSETFASTINT (Vlong_line_threshold, 10000); |
| 6444 | 6444 | ||
| 6445 | DEFVAR_INT ("large-hscroll-threshold", large_hscroll_threshold, | ||
| 6446 | doc: /* Horizontal scroll of truncated lines above which to use redisplay shortcuts. | ||
| 6447 | |||
| 6448 | The value should be a positive integer. | ||
| 6449 | |||
| 6450 | Shortcuts in the display code intended to speed up redisplay for long | ||
| 6451 | and truncated lines will automatically be enabled when a line's | ||
| 6452 | horizontal scroll amount is or about to become larger than the value | ||
| 6453 | of this variable. | ||
| 6454 | |||
| 6455 | This variable has effect only in buffers which contain one or more | ||
| 6456 | lines whose length is above `long-line-threshold', which see. | ||
| 6457 | To disable redisplay shortcuts for long truncated line, set this | ||
| 6458 | variable to `most-positive-fixnum'. | ||
| 6459 | |||
| 6460 | There is no reason to change that value except for debugging purposes. */); | ||
| 6461 | large_hscroll_threshold = 10000; | ||
| 6462 | |||
| 6445 | defsubr (&Sbuffer_live_p); | 6463 | defsubr (&Sbuffer_live_p); |
| 6446 | defsubr (&Sbuffer_list); | 6464 | defsubr (&Sbuffer_list); |
| 6447 | defsubr (&Sget_buffer); | 6465 | defsubr (&Sget_buffer); |