aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorGregory Heytings2022-11-26 14:09:41 +0000
committerGregory Heytings2022-11-26 15:10:17 +0100
commit558084c7f736bebcb3cffc2bf4f617158d92357f (patch)
tree5e05c5a457fe09073321b6b6543f1bbc00e766ed /src/keyboard.c
parent16b8b0d1e07d394e01f76d9eed6006219b4d745b (diff)
downloademacs-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/keyboard.c')
-rw-r--r--src/keyboard.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 4b35a044eb0..cb308f5bfc1 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1911,8 +1911,8 @@ safe_run_hooks_maybe_narrowed (Lisp_Object hook, struct window *w)
1911 specbind (Qinhibit_quit, Qt); 1911 specbind (Qinhibit_quit, Qt);
1912 1912
1913 if (current_buffer->long_line_optimizations_p) 1913 if (current_buffer->long_line_optimizations_p)
1914 narrow_to_region_locked (make_fixnum (get_narrowed_begv (w, PT)), 1914 narrow_to_region_locked (make_fixnum (get_locked_narrowing_begv (PT)),
1915 make_fixnum (get_narrowed_zv (w, PT)), 1915 make_fixnum (get_locked_narrowing_zv (PT)),
1916 hook); 1916 hook);
1917 1917
1918 run_hook_with_args (2, ((Lisp_Object []) {hook, hook}), 1918 run_hook_with_args (2, ((Lisp_Object []) {hook, hook}),