diff options
| author | Gregory Heytings | 2023-02-10 22:48:04 +0000 |
|---|---|---|
| committer | Gregory Heytings | 2023-02-10 23:52:24 +0100 |
| commit | e89361844f3648de2e5efaa496ceb04a78cf8439 (patch) | |
| tree | 9a9b8265eb2778111111d6f635492e5631c944c9 | |
| parent | 11362dc5725dd1c8eb73c48e225bfeb266c28d3d (diff) | |
| download | emacs-e89361844f3648de2e5efaa496ceb04a78cf8439.tar.gz emacs-e89361844f3648de2e5efaa496ceb04a78cf8439.zip | |
Remove functions and variables for locked narrowings
* src/dispextern.h (struct it): Remove two fields.
Remove external declarations for two removed functions.
* src/xdisp.c (get_locked_narrowing_begv)
(get_locked_narrowing_zv): Remove.
(reseat): Do not set the two removed fields anymore.
* src/buffer.c (syms_of_buffer): Remove two variables.
| -rw-r--r-- | src/buffer.c | 35 | ||||
| -rw-r--r-- | src/dispextern.h | 10 | ||||
| -rw-r--r-- | src/xdisp.c | 35 |
3 files changed, 0 insertions, 80 deletions
diff --git a/src/buffer.c b/src/buffer.c index 38648519ba0..b60553435f9 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5916,41 +5916,6 @@ If nil, these display shortcuts will always remain disabled. | |||
| 5916 | There is no reason to change that value except for debugging purposes. */); | 5916 | There is no reason to change that value except for debugging purposes. */); |
| 5917 | XSETFASTINT (Vlong_line_threshold, 50000); | 5917 | XSETFASTINT (Vlong_line_threshold, 50000); |
| 5918 | 5918 | ||
| 5919 | DEFVAR_INT ("long-line-locked-narrowing-region-size", | ||
| 5920 | long_line_locked_narrowing_region_size, | ||
| 5921 | doc: /* Region size for locked narrowing in buffers with long lines. | ||
| 5922 | |||
| 5923 | This variable has effect only in buffers which contain one or more | ||
| 5924 | lines whose length is above `long-line-threshold', which see. For | ||
| 5925 | performance reasons, in such buffers, low-level hooks such as | ||
| 5926 | `fontification-functions' or `post-command-hook' are executed on a | ||
| 5927 | narrowed buffer, with a narrowing locked with `narrowing-lock'. This | ||
| 5928 | variable specifies the size of the narrowed region around point. | ||
| 5929 | |||
| 5930 | To disable that narrowing, set this variable to 0. | ||
| 5931 | |||
| 5932 | See also `long-line-locked-narrowing-bol-search-limit'. | ||
| 5933 | |||
| 5934 | There is no reason to change that value except for debugging purposes. */); | ||
| 5935 | long_line_locked_narrowing_region_size = 500000; | ||
| 5936 | |||
| 5937 | DEFVAR_INT ("long-line-locked-narrowing-bol-search-limit", | ||
| 5938 | long_line_locked_narrowing_bol_search_limit, | ||
| 5939 | doc: /* Limit for beginning of line search in buffers with long lines. | ||
| 5940 | |||
| 5941 | This variable has effect only in buffers which contain one or more | ||
| 5942 | lines whose length is above `long-line-threshold', which see. For | ||
| 5943 | performance reasons, in such buffers, low-level hooks such as | ||
| 5944 | `fontification-functions' or `post-command-hook' are executed on a | ||
| 5945 | narrowed buffer, with a narrowing locked with `narrowing-lock'. The | ||
| 5946 | variable `long-line-locked-narrowing-region-size' specifies the size | ||
| 5947 | of the narrowed region around point. This variable, which should be a | ||
| 5948 | small integer, specifies the number of characters by which that region | ||
| 5949 | can be extended backwards to make it start at the beginning of a line. | ||
| 5950 | |||
| 5951 | There is no reason to change that value except for debugging purposes. */); | ||
| 5952 | long_line_locked_narrowing_bol_search_limit = 128; | ||
| 5953 | |||
| 5954 | DEFVAR_INT ("large-hscroll-threshold", large_hscroll_threshold, | 5919 | DEFVAR_INT ("large-hscroll-threshold", large_hscroll_threshold, |
| 5955 | doc: /* Horizontal scroll of truncated lines above which to use redisplay shortcuts. | 5920 | doc: /* Horizontal scroll of truncated lines above which to use redisplay shortcuts. |
| 5956 | 5921 | ||
diff --git a/src/dispextern.h b/src/dispextern.h index 4dcab113ea2..a18bb781258 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -2342,14 +2342,6 @@ struct it | |||
| 2342 | optimize display. */ | 2342 | optimize display. */ |
| 2343 | ptrdiff_t narrowed_zv; | 2343 | ptrdiff_t narrowed_zv; |
| 2344 | 2344 | ||
| 2345 | /* Begin position of the buffer for the locked narrowing around | ||
| 2346 | low-level hooks. */ | ||
| 2347 | ptrdiff_t locked_narrowing_begv; | ||
| 2348 | |||
| 2349 | /* End position of the buffer for the locked narrowing around | ||
| 2350 | low-level hooks. */ | ||
| 2351 | ptrdiff_t locked_narrowing_zv; | ||
| 2352 | |||
| 2353 | /* C string to iterate over. Non-null means get characters from | 2345 | /* C string to iterate over. Non-null means get characters from |
| 2354 | this string, otherwise characters are read from current_buffer | 2346 | this string, otherwise characters are read from current_buffer |
| 2355 | or it->string. */ | 2347 | or it->string. */ |
| @@ -3413,8 +3405,6 @@ void init_iterator (struct it *, struct window *, ptrdiff_t, | |||
| 3413 | ptrdiff_t get_narrowed_begv (struct window *, ptrdiff_t); | 3405 | ptrdiff_t get_narrowed_begv (struct window *, ptrdiff_t); |
| 3414 | ptrdiff_t get_narrowed_zv (struct window *, ptrdiff_t); | 3406 | ptrdiff_t get_narrowed_zv (struct window *, ptrdiff_t); |
| 3415 | ptrdiff_t get_closer_narrowed_begv (struct window *, ptrdiff_t); | 3407 | ptrdiff_t get_closer_narrowed_begv (struct window *, ptrdiff_t); |
| 3416 | ptrdiff_t get_locked_narrowing_begv (ptrdiff_t); | ||
| 3417 | ptrdiff_t get_locked_narrowing_zv (ptrdiff_t); | ||
| 3418 | void init_iterator_to_row_start (struct it *, struct window *, | 3408 | void init_iterator_to_row_start (struct it *, struct window *, |
| 3419 | struct glyph_row *); | 3409 | struct glyph_row *); |
| 3420 | void start_display (struct it *, struct window *, struct text_pos); | 3410 | void start_display (struct it *, struct window *, struct text_pos); |
diff --git a/src/xdisp.c b/src/xdisp.c index c3df8cd98f3..eaf5cfc88ed 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3533,33 +3533,6 @@ get_closer_narrowed_begv (struct window *w, ptrdiff_t pos) | |||
| 3533 | return max ((pos / len - 1) * len, BEGV); | 3533 | return max ((pos / len - 1) * len, BEGV); |
| 3534 | } | 3534 | } |
| 3535 | 3535 | ||
| 3536 | ptrdiff_t | ||
| 3537 | get_locked_narrowing_begv (ptrdiff_t pos) | ||
| 3538 | { | ||
| 3539 | if (long_line_locked_narrowing_region_size <= 0) | ||
| 3540 | return BEGV; | ||
| 3541 | int len = long_line_locked_narrowing_region_size / 2; | ||
| 3542 | int begv = max (pos - len, BEGV); | ||
| 3543 | int limit = long_line_locked_narrowing_bol_search_limit; | ||
| 3544 | while (limit > 0) | ||
| 3545 | { | ||
| 3546 | if (begv == BEGV || FETCH_BYTE (CHAR_TO_BYTE (begv) - 1) == '\n') | ||
| 3547 | return begv; | ||
| 3548 | begv--; | ||
| 3549 | limit--; | ||
| 3550 | } | ||
| 3551 | return begv; | ||
| 3552 | } | ||
| 3553 | |||
| 3554 | ptrdiff_t | ||
| 3555 | get_locked_narrowing_zv (ptrdiff_t pos) | ||
| 3556 | { | ||
| 3557 | if (long_line_locked_narrowing_region_size <= 0) | ||
| 3558 | return ZV; | ||
| 3559 | int len = long_line_locked_narrowing_region_size / 2; | ||
| 3560 | return min (pos + len, ZV); | ||
| 3561 | } | ||
| 3562 | |||
| 3563 | static void | 3536 | static void |
| 3564 | unwind_narrowed_begv (Lisp_Object point_min) | 3537 | unwind_narrowed_begv (Lisp_Object point_min) |
| 3565 | { | 3538 | { |
| @@ -7451,20 +7424,12 @@ reseat (struct it *it, struct text_pos pos, bool force_p) | |||
| 7451 | { | 7424 | { |
| 7452 | it->narrowed_begv = get_narrowed_begv (it->w, window_point (it->w)); | 7425 | it->narrowed_begv = get_narrowed_begv (it->w, window_point (it->w)); |
| 7453 | it->narrowed_zv = get_narrowed_zv (it->w, window_point (it->w)); | 7426 | it->narrowed_zv = get_narrowed_zv (it->w, window_point (it->w)); |
| 7454 | it->locked_narrowing_begv | ||
| 7455 | = get_locked_narrowing_begv (window_point (it->w)); | ||
| 7456 | it->locked_narrowing_zv | ||
| 7457 | = get_locked_narrowing_zv (window_point (it->w)); | ||
| 7458 | } | 7427 | } |
| 7459 | else if ((pos.charpos < it->narrowed_begv || pos.charpos > it->narrowed_zv) | 7428 | else if ((pos.charpos < it->narrowed_begv || pos.charpos > it->narrowed_zv) |
| 7460 | && (!redisplaying_p || it->line_wrap == TRUNCATE)) | 7429 | && (!redisplaying_p || it->line_wrap == TRUNCATE)) |
| 7461 | { | 7430 | { |
| 7462 | it->narrowed_begv = get_narrowed_begv (it->w, pos.charpos); | 7431 | it->narrowed_begv = get_narrowed_begv (it->w, pos.charpos); |
| 7463 | it->narrowed_zv = get_narrowed_zv (it->w, pos.charpos); | 7432 | it->narrowed_zv = get_narrowed_zv (it->w, pos.charpos); |
| 7464 | it->locked_narrowing_begv | ||
| 7465 | = get_locked_narrowing_begv (window_point (it->w)); | ||
| 7466 | it->locked_narrowing_zv | ||
| 7467 | = get_locked_narrowing_zv (window_point (it->w)); | ||
| 7468 | } | 7433 | } |
| 7469 | } | 7434 | } |
| 7470 | 7435 | ||