diff options
| author | Gregory Heytings | 2022-11-26 14:09:41 +0000 |
|---|---|---|
| committer | Gregory Heytings | 2022-11-26 15:10:17 +0100 |
| commit | 558084c7f736bebcb3cffc2bf4f617158d92357f (patch) | |
| tree | 5e05c5a457fe09073321b6b6543f1bbc00e766ed /src/dispextern.h | |
| parent | 16b8b0d1e07d394e01f76d9eed6006219b4d745b (diff) | |
| download | emacs-558084c7f736bebcb3cffc2bf4f617158d92357f.tar.gz emacs-558084c7f736bebcb3cffc2bf4f617158d92357f.zip | |
Improve locked narrowing around low-level hooks.
* src/buffer.c (syms_of_buffer): Two new variables,
'long-line-locked-narrowing-region-size' and
'long-line-locked-narrowing-bol-search-limit', to make the locked
narrowing around low-level hooks configurable.
Increase the default value of 'long-line-threshold'. After
carefully considering the (few) bug reports about long line
optimizations, I concluded that the previous default value was too
low.
* src/xdisp.c (get_locked_narrowing_begv)
(get_locked_narrowing_zv): Two new functions.
(handle_fontified_prop, reseat): Use them.
* src/keyboard.c (safe_run_hooks_maybe_narrowed): Use them.
* src/dispextern.h (struct it): Add two new fields to store the
values returned by these functions.
Make them externally visible.
* src/editfns.c: (Fsave_restriction): Update docstring.
Diffstat (limited to 'src/dispextern.h')
| -rw-r--r-- | src/dispextern.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 2afbdeabaab..df6134e68f0 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -2342,6 +2342,14 @@ 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 | |||
| 2345 | /* C string to iterate over. Non-null means get characters from | 2353 | /* C string to iterate over. Non-null means get characters from |
| 2346 | this string, otherwise characters are read from current_buffer | 2354 | this string, otherwise characters are read from current_buffer |
| 2347 | or it->string. */ | 2355 | or it->string. */ |
| @@ -3405,6 +3413,8 @@ void init_iterator (struct it *, struct window *, ptrdiff_t, | |||
| 3405 | ptrdiff_t get_narrowed_begv (struct window *, ptrdiff_t); | 3413 | ptrdiff_t get_narrowed_begv (struct window *, ptrdiff_t); |
| 3406 | ptrdiff_t get_narrowed_zv (struct window *, ptrdiff_t); | 3414 | ptrdiff_t get_narrowed_zv (struct window *, ptrdiff_t); |
| 3407 | ptrdiff_t get_closer_narrowed_begv (struct window *, ptrdiff_t); | 3415 | 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); | ||
| 3408 | void init_iterator_to_row_start (struct it *, struct window *, | 3418 | void init_iterator_to_row_start (struct it *, struct window *, |
| 3409 | struct glyph_row *); | 3419 | struct glyph_row *); |
| 3410 | void start_display (struct it *, struct window *, struct text_pos); | 3420 | void start_display (struct it *, struct window *, struct text_pos); |