From f01d3321d5a7ca4147b675f02d5aa51dc65c2b55 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 23 Feb 2012 15:28:21 +0800 Subject: Avoid infloop in next-frame during frame creation. See thread at http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00573.html * src/window.c (inhibit_window_configuration_change_hook): New var. (run_window_configuration_change_hook): Obey it. * src/xfns.c (Fx_create_frame): Avoid window-configuration-change-hook call when setting menu-bar-lines and tool-bar-lines parameters. (unwind_create_frame_1): New helper function. --- src/window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index 95e7d8a5685..397d84a8b05 100644 --- a/src/window.c +++ b/src/window.c @@ -122,6 +122,9 @@ static int window_initialized; /* Hook to run when window config changes. */ static Lisp_Object Qwindow_configuration_change_hook; +/* If non-nil, run_window_configuration_change_hook does nothing. */ +Lisp_Object inhibit_window_configuration_change_hook; + /* Used by the function window_scroll_pixel_based */ static int window_scroll_pixel_based_preserve_x; static int window_scroll_pixel_based_preserve_y; @@ -2894,7 +2897,7 @@ run_window_configuration_change_hook (struct frame *f) = Fdefault_value (Qwindow_configuration_change_hook); XSETFRAME (frame, f); - if (NILP (Vrun_hooks)) + if (NILP (Vrun_hooks) || !NILP (inhibit_window_configuration_change_hook)) return; /* Use the right buffer. Matters when running the local hooks. */ -- cgit v1.2.1