summaryrefslogtreecommitdiff
path: root/src/intervals.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2017-08-21 20:21:28 +0300
committerEli Zaretskii <eliz@gnu.org>2017-08-21 20:21:28 +0300
commit80fccd4290ae134bd1b3d377f134bb9143b68b43 (patch)
treef68161a9f52c1dca91533c623396922df4308fa7 /src/intervals.c
parent694e2d8f2354b68f60513915cb8a9c9d1a11ce81 (diff)
downloademacs-80fccd4290ae134bd1b3d377f134bb9143b68b43.tar.gz
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)
Diffstat (limited to 'src/intervals.c')
-rw-r--r--src/intervals.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/intervals.c b/src/intervals.c
index 0089ecb8dde..e65c22977ed 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -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);