[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 80fccd4: Avoid losing the buffer restriction in fly
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] master 80fccd4: Avoid losing the buffer restriction in flyspell-mode |
Date: |
Mon, 21 Aug 2017 13:22:32 -0400 (EDT) |
branch: master
commit 80fccd4290ae134bd1b3d377f134bb9143b68b43
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
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)
---
src/intervals.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/intervals.c b/src/intervals.c
index 0089ecb..e65c229 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);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 80fccd4: Avoid losing the buffer restriction in flyspell-mode,
Eli Zaretskii <=