[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 56ab6203fa: Do not enter locked narrowing when it would span the
From: |
Gregory Heytings |
Subject: |
master 56ab6203fa: Do not enter locked narrowing when it would span the whole buffer |
Date: |
Sun, 27 Nov 2022 20:22:10 -0500 (EST) |
branch: master
commit 56ab6203fa96a3bf203aa6bdcb11753ff0adf962
Author: Gregory Heytings <gregory@heytings.org>
Commit: Gregory Heytings <gregory@heytings.org>
Do not enter locked narrowing when it would span the whole buffer
* src/xdisp.c (handle_fontified_prop):
* src/keyboard.c (safe_run_hooks_maybe_narrowed): Add condition.
---
src/keyboard.c | 9 ++++++---
src/xdisp.c | 5 +++--
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/keyboard.c b/src/keyboard.c
index ac40ba059e..d68b50428a 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1912,9 +1912,12 @@ safe_run_hooks_maybe_narrowed (Lisp_Object hook, struct
window *w)
if (current_buffer->long_line_optimizations_p
&& long_line_locked_narrowing_region_size > 0)
- narrow_to_region_locked (make_fixnum (get_locked_narrowing_begv (PT)),
- make_fixnum (get_locked_narrowing_zv (PT)),
- hook);
+ {
+ ptrdiff_t begv = get_locked_narrowing_begv (PT);
+ ptrdiff_t zv = get_locked_narrowing_zv (PT);
+ if (begv != BEG || zv != Z)
+ narrow_to_region_locked (make_fixnum (begv), make_fixnum (zv), hook);
+ }
run_hook_with_args (2, ((Lisp_Object []) {hook, hook}),
safe_run_hook_funcall);
diff --git a/src/xdisp.c b/src/xdisp.c
index d423a77bde..b09aa6ec96 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4404,8 +4404,9 @@ handle_fontified_prop (struct it *it)
begv = get_locked_narrowing_begv (charpos);
zv = get_locked_narrowing_zv (charpos);
}
- narrow_to_region_locked (make_fixnum (begv), make_fixnum (zv),
- Qfontification_functions);
+ if (begv != BEG || zv != Z)
+ narrow_to_region_locked (make_fixnum (begv), make_fixnum (zv),
+ Qfontification_functions);
}
/* Don't allow Lisp that runs from 'fontification-functions'
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 56ab6203fa: Do not enter locked narrowing when it would span the whole buffer,
Gregory Heytings <=