aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/lisp.h25
-rw-r--r--src/window.c5
-rw-r--r--src/window.h4
-rw-r--r--src/xfns.c42
5 files changed, 67 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5a376c4ad5b..3d660159a1a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12012-02-23 Chong Yidong <cyd@gnu.org>
2
3 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
4 call when setting menu-bar-lines and tool-bar-lines parameters.
5 (unwind_create_frame_1): New helper function.
6
7 * window.c (inhibit_window_configuration_change_hook): New var.
8 (run_window_configuration_change_hook): Obey it.
9
12012-02-22 Chong Yidong <cyd@gnu.org> 102012-02-22 Chong Yidong <cyd@gnu.org>
2 11
3 * xterm.c (x_draw_image_relief): Add missing type check for 12 * xterm.c (x_draw_image_relief): Add missing type check for
diff --git a/src/lisp.h b/src/lisp.h
index 9199c9aabcf..8ddc7ef143d 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -195,12 +195,25 @@ extern int suppress_checking EXTERNALLY_VISIBLE;
195 || defined DARWIN_OS || defined __sun) 195 || defined DARWIN_OS || defined __sun)
196/* We also need to be able to specify mult-of-8 alignment on static vars. */ 196/* We also need to be able to specify mult-of-8 alignment on static vars. */
197# if defined DECL_ALIGN 197# if defined DECL_ALIGN
198/* mark_maybe_object assumes that EMACS_INT values are contiguous, 198/* On hosts where VALBITS is greater than the pointer width in bits,
199 but this is not true on some hosts where EMACS_INT is wider than a pointer, 199 USE_LSB_TAG is:
200 as they may allocate the halves of an EMACS_INT separately. 200
201 On these hosts USE_LSB_TAG is not needed because the top bits of an 201 a. unnecessary, because the top bits of an EMACS_INT are unused,
202 EMACS_INT are unused, so define USE_LSB_TAG only on hosts where it 202
203 might be useful. */ 203 b. slower, because it typically requires extra masking, and
204
205 c. harmful, because it can create Lisp_Object values that are so scrambled
206 that mark_maybe_object cannot decipher them. mark_maybe_object assumes
207 that EMACS_INT values are contiguous, but a host where EMACS_INT is
208 wider than a pointer might allocate the top half of an EMACS_INT in
209 (say) a 32-bit word on the stack, putting the bottom half in a 32-bit
210 register that is saved elsewhere in a jmp_buf. When this happens,
211 since USE_LSB_TAG is not defined the bottom half alone is a valid
212 pointer that mark_maybe_pointer can follow; but if USE_LSB_TAG were
213 defined, the bottom half would not be a valid pointer and neither
214 mark_maybe_object nor mark_maybe_pointer would follow it.
215
216 So, define USE_LSB_TAG only on hosts where it might be useful. */
204# if UINTPTR_MAX >> VALBITS != 0 217# if UINTPTR_MAX >> VALBITS != 0
205# define USE_LSB_TAG 218# define USE_LSB_TAG
206# endif 219# endif
diff --git a/src/window.c b/src/window.c
index b50ae71df8c..ac462624495 100644
--- a/src/window.c
+++ b/src/window.c
@@ -124,6 +124,9 @@ static int window_initialized;
124/* Hook to run when window config changes. */ 124/* Hook to run when window config changes. */
125static Lisp_Object Qwindow_configuration_change_hook; 125static Lisp_Object Qwindow_configuration_change_hook;
126 126
127/* If non-nil, run_window_configuration_change_hook does nothing. */
128Lisp_Object inhibit_window_configuration_change_hook;
129
127/* Used by the function window_scroll_pixel_based */ 130/* Used by the function window_scroll_pixel_based */
128static int window_scroll_pixel_based_preserve_x; 131static int window_scroll_pixel_based_preserve_x;
129static int window_scroll_pixel_based_preserve_y; 132static int window_scroll_pixel_based_preserve_y;
@@ -2896,7 +2899,7 @@ run_window_configuration_change_hook (struct frame *f)
2896 = Fdefault_value (Qwindow_configuration_change_hook); 2899 = Fdefault_value (Qwindow_configuration_change_hook);
2897 XSETFRAME (frame, f); 2900 XSETFRAME (frame, f);
2898 2901
2899 if (NILP (Vrun_hooks)) 2902 if (NILP (Vrun_hooks) || !NILP (inhibit_window_configuration_change_hook))
2900 return; 2903 return;
2901 2904
2902 /* Use the right buffer. Matters when running the local hooks. */ 2905 /* Use the right buffer. Matters when running the local hooks. */
diff --git a/src/window.h b/src/window.h
index ea127ca95a8..f4a5f52b9a5 100644
--- a/src/window.h
+++ b/src/window.h
@@ -810,6 +810,10 @@ extern Lisp_Object Vmouse_window;
810 810
811extern Lisp_Object Vmouse_event; 811extern Lisp_Object Vmouse_event;
812 812
813/* If non-nil, run_window_configuration_change_hook does nothing. */
814
815extern Lisp_Object inhibit_window_configuration_change_hook;
816
813EXFUN (Fnext_window, 3); 817EXFUN (Fnext_window, 3);
814EXFUN (Fselect_window, 2); 818EXFUN (Fselect_window, 2);
815EXFUN (Fset_window_buffer, 3); 819EXFUN (Fset_window_buffer, 3);
diff --git a/src/xfns.c b/src/xfns.c
index f00335b5d03..6fcd129e4a4 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2949,6 +2949,12 @@ unwind_create_frame (Lisp_Object frame)
2949 return Qnil; 2949 return Qnil;
2950} 2950}
2951 2951
2952static Lisp_Object
2953unwind_create_frame_1 (Lisp_Object val)
2954{
2955 inhibit_window_configuration_change_hook = val;
2956 return Qnil;
2957}
2952 2958
2953static void 2959static void
2954x_default_font_parameter (struct frame *f, Lisp_Object parms) 2960x_default_font_parameter (struct frame *f, Lisp_Object parms)
@@ -3321,17 +3327,31 @@ This function is an internal primitive--use `make-frame' instead. */)
3321 happen. */ 3327 happen. */
3322 init_frame_faces (f); 3328 init_frame_faces (f);
3323 3329
3324 /* The X resources controlling the menu-bar and tool-bar are 3330 /* Set the menu-bar-lines and tool-bar-lines parameters. We don't
3325 processed specially at startup, and reflected in the mode 3331 look up the X resources controlling the menu-bar and tool-bar
3326 variables; ignore them here. */ 3332 here; they are processed specially at startup, and reflected in
3327 x_default_parameter (f, parms, Qmenu_bar_lines, 3333 the values of the mode variables.
3328 NILP (Vmenu_bar_mode) 3334
3329 ? make_number (0) : make_number (1), 3335 Avoid calling window-configuration-change-hook; otherwise we
3330 NULL, NULL, RES_TYPE_NUMBER); 3336 could get an infloop in next_frame since the frame is not yet in
3331 x_default_parameter (f, parms, Qtool_bar_lines, 3337 Vframe_list. */
3332 NILP (Vtool_bar_mode) 3338 {
3333 ? make_number (0) : make_number (1), 3339 int count2 = SPECPDL_INDEX ();
3334 NULL, NULL, RES_TYPE_NUMBER); 3340 record_unwind_protect (unwind_create_frame_1,
3341 inhibit_window_configuration_change_hook);
3342 inhibit_window_configuration_change_hook = Qt;
3343
3344 x_default_parameter (f, parms, Qmenu_bar_lines,
3345 NILP (Vmenu_bar_mode)
3346 ? make_number (0) : make_number (1),
3347 NULL, NULL, RES_TYPE_NUMBER);
3348 x_default_parameter (f, parms, Qtool_bar_lines,
3349 NILP (Vtool_bar_mode)
3350 ? make_number (0) : make_number (1),
3351 NULL, NULL, RES_TYPE_NUMBER);
3352
3353 unbind_to (count2, Qnil);
3354 }
3335 3355
3336 x_default_parameter (f, parms, Qbuffer_predicate, Qnil, 3356 x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
3337 "bufferPredicate", "BufferPredicate", 3357 "bufferPredicate", "BufferPredicate",