summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorGregory Heytings <gregory@heytings.org>2022-08-01 15:52:12 +0000
committerGregory Heytings <gregory@heytings.org>2022-08-01 17:52:55 +0200
commit5dc65c10ca1a2504699ad5374fedb127960946c8 (patch)
treeab669a73d5e47f5cb80a22a8d9ac5dc1e1f26c3f /src/keyboard.c
parent38d970b748a23d3b8dad6feef8e392f1d6d3c9e5 (diff)
downloademacs-5dc65c10ca1a2504699ad5374fedb127960946c8.tar.gz
Various improvements to long lines handling.
* src/xdisp.c (get_visually_first_element, (move_it_vertically_backward): Do not go back too far with bidi. (get_narrowed_begv): Do not return 0 anymore instead of BEGV. (handle_fontified_prop): Simplify accordingly. * src/keyboard.c (safe_run_hooks_maybe_narrowed): Simplify accordingly. * src/composite.c (find_automatic_composition): Ditto.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 094119340e1..a730dfe4fda 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1907,12 +1907,9 @@ safe_run_hooks_maybe_narrowed (Lisp_Object hook, struct window *w)
specbind (Qinhibit_quit, Qt);
if (current_buffer->long_line_optimizations_p)
- {
- ptrdiff_t begv = get_narrowed_begv (w, PT);
- ptrdiff_t zv = get_narrowed_zv (w, PT);
- if (!begv) begv = BEGV;
- Fnarrow_to_region (make_fixnum (begv), make_fixnum (zv), Qt);
- }
+ Fnarrow_to_region (make_fixnum (get_narrowed_begv (w, PT)),
+ make_fixnum (get_narrowed_zv (w, PT)),
+ Qt);
run_hook_with_args (2, ((Lisp_Object []) {hook, hook}), safe_run_hook_funcall);
unbind_to (count, Qnil);