mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
Avoid losing the buffer restriction in flyspell-mode
* src/intervals.c (get_local_map): Don't allow C-g to quit as long as we have the buffer widened, to make sure the restriction is preserved. (Bug#28161)
This commit is contained in:
parent
694e2d8f23
commit
80fccd4290
1 changed files with 3 additions and 0 deletions
|
|
@ -2153,6 +2153,7 @@ get_local_map (ptrdiff_t position, struct buffer *buffer, Lisp_Object type)
|
|||
{
|
||||
Lisp_Object prop, lispy_position, lispy_buffer;
|
||||
ptrdiff_t old_begv, old_zv, old_begv_byte, old_zv_byte;
|
||||
ptrdiff_t count = SPECPDL_INDEX ();
|
||||
|
||||
position = clip_to_bounds (BUF_BEGV (buffer), position, BUF_ZV (buffer));
|
||||
|
||||
|
|
@ -2163,6 +2164,7 @@ get_local_map (ptrdiff_t position, struct buffer *buffer, Lisp_Object type)
|
|||
old_begv_byte = BUF_BEGV_BYTE (buffer);
|
||||
old_zv_byte = BUF_ZV_BYTE (buffer);
|
||||
|
||||
specbind (Qinhibit_quit, Qt);
|
||||
SET_BUF_BEGV_BOTH (buffer, BUF_BEG (buffer), BUF_BEG_BYTE (buffer));
|
||||
SET_BUF_ZV_BOTH (buffer, BUF_Z (buffer), BUF_Z_BYTE (buffer));
|
||||
|
||||
|
|
@ -2180,6 +2182,7 @@ get_local_map (ptrdiff_t position, struct buffer *buffer, Lisp_Object type)
|
|||
|
||||
SET_BUF_BEGV_BOTH (buffer, old_begv, old_begv_byte);
|
||||
SET_BUF_ZV_BOTH (buffer, old_zv, old_zv_byte);
|
||||
unbind_to (count, Qnil);
|
||||
|
||||
/* Use the local map only if it is valid. */
|
||||
prop = get_keymap (prop, 0, 0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue