[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 7b4a0e2: Avoid inflooping in redisplay due to Space
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] master 7b4a0e2: Avoid inflooping in redisplay due to Spacemacs and linum-mode |
Date: |
Wed, 31 May 2017 05:06:07 -0400 (EDT) |
branch: master
commit 7b4a0e2884004f44f3bdebecbcdfb6b6dcf99fdd
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Avoid inflooping in redisplay due to Spacemacs and linum-mode
* src/xdisp.c (redisplay_internal): Limit the number of redisplay
retries when a frame becomes garbaged as result of redisplaying
it. (Bug#27115)
---
src/xdisp.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/xdisp.c b/src/xdisp.c
index c03689b..f4461c1 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13648,6 +13648,14 @@ redisplay_internal (void)
enum { MAX_HSCROLL_RETRIES = 16 };
int hscroll_retries = 0;
+ /* Limit the number of retries for when frame(s) become garbaged as
+ result of redisplaying them. Some packages set various redisplay
+ hooks, such as window-scroll-functions, to run Lisp that always
+ calls APIs which cause the frame's garbaged flag to become set,
+ so we loop indefinitely. */
+ enum {MAX_GARBAGED_FRAME_RETRIES = 2 };
+ int garbaged_frame_retries = 0;
+
/* True means redisplay has to consider all windows on all
frames. False, only selected_window is considered. */
bool consider_all_windows_p;
@@ -14194,7 +14202,8 @@ redisplay_internal (void)
garbage. We have to start over. These cases
should be rare, so going all the way back to the
top of redisplay should be good enough. */
- if (FRAME_GARBAGED_P (f))
+ if (FRAME_GARBAGED_P (f)
+ && garbaged_frame_retries++ < MAX_GARBAGED_FRAME_RETRIES)
goto retry;
#if defined (HAVE_WINDOW_SYSTEM) && !defined (HAVE_NS)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 7b4a0e2: Avoid inflooping in redisplay due to Spacemacs and linum-mode,
Eli Zaretskii <=