From 08908acaa6d4e2679cf2fc32c91c17906a4de639 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 14 Aug 2012 10:44:24 +0200 Subject: [PATCH] Don't call Fset_window_buffer from C code. * frame.c (make_frame_without_minibuffer, make_minibuffer_frame) (delete_frame, Fmake_frame_invisible, Ficonify_frame): * minibuf.c (choose_minibuf_frame, read_minibuf): * w32fns.c (x_create_tip_frame): * xfns.c (x_create_tip_frame): Call set_window_buffer instead of Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026). --- src/ChangeLog | 9 +++++++++ src/frame.c | 40 +++++++++++++++++++++++++--------------- src/minibuf.c | 12 +++++++++--- src/w32fns.c | 4 +++- src/xfns.c | 4 +++- 5 files changed, 49 insertions(+), 20 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b752db53eee..cf24ee95a05 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-08-14 Martin Rudalics + + * frame.c (make_frame_without_minibuffer, make_minibuffer_frame) + (delete_frame, Fmake_frame_invisible, Ficonify_frame): + * minibuf.c (choose_minibuf_frame, read_minibuf): + * w32fns.c (x_create_tip_frame): + * xfns.c (x_create_tip_frame): Call set_window_buffer instead of + Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026). + 2012-08-14 Paul Eggert * intervals.c (offset_intervals): Remove obsolete comment. diff --git a/src/frame.c b/src/frame.c index b2990929058..ea682835a87 100644 --- a/src/frame.c +++ b/src/frame.c @@ -407,10 +407,12 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis /* Make the chosen minibuffer window display the proper minibuffer, unless it is already showing a minibuffer. */ if (NILP (Fmemq (XWINDOW (mini_window)->buffer, Vminibuffer_list))) - Fset_window_buffer (mini_window, - (NILP (Vminibuffer_list) - ? get_minibuffer (0) - : Fcar (Vminibuffer_list)), Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (mini_window, + (NILP (Vminibuffer_list) + ? get_minibuffer (0) + : Fcar (Vminibuffer_list)), 0, 0); return f; } @@ -445,10 +447,12 @@ make_minibuffer_frame (void) /* Put the proper buffer in that window. */ - Fset_window_buffer (mini_window, - (NILP (Vminibuffer_list) - ? get_minibuffer (0) - : Fcar (Vminibuffer_list)), Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (mini_window, + (NILP (Vminibuffer_list) + ? get_minibuffer (0) + : Fcar (Vminibuffer_list)), 0, 0); return f; } #endif /* HAVE_WINDOW_SYSTEM */ @@ -1240,8 +1244,10 @@ delete_frame (Lisp_Object frame, Lisp_Object force) /* Don't allow minibuf_window to remain on a deleted frame. */ if (EQ (f->minibuffer_window, minibuf_window)) { - Fset_window_buffer (sf->minibuffer_window, - XWINDOW (minibuf_window)->buffer, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (sf->minibuffer_window, + XWINDOW (minibuf_window)->buffer, 0, 0); minibuf_window = sf->minibuffer_window; /* If the dying minibuffer window was selected, @@ -1713,8 +1719,10 @@ displayed in the terminal. */) if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) { struct frame *sf = XFRAME (selected_frame); - Fset_window_buffer (sf->minibuffer_window, - XWINDOW (minibuf_window)->buffer, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (sf->minibuffer_window, + XWINDOW (minibuf_window)->buffer, 0, 0); minibuf_window = sf->minibuffer_window; } @@ -1747,12 +1755,14 @@ If omitted, FRAME defaults to the currently selected frame. */) Fhandle_switch_frame (next_frame (frame, Qt)); #endif - /* Don't allow minibuf_window to remain on a deleted frame. */ + /* Don't allow minibuf_window to remain on an iconified frame. */ if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) { struct frame *sf = XFRAME (selected_frame); - Fset_window_buffer (sf->minibuffer_window, - XWINDOW (minibuf_window)->buffer, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (sf->minibuffer_window, + XWINDOW (minibuf_window)->buffer, 0, 0); minibuf_window = sf->minibuffer_window; } diff --git a/src/minibuf.c b/src/minibuf.c index 3a384bf57bb..59da974df00 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -117,7 +117,9 @@ choose_minibuf_frame (void) init_window_once. That window doesn't have a buffer. */ buffer = XWINDOW (minibuf_window)->buffer; if (BUFFERP (buffer)) - Fset_window_buffer (sf->minibuffer_window, buffer, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (sf->minibuffer_window, buffer, 0, 0); minibuf_window = sf->minibuffer_window; } @@ -617,11 +619,15 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, if (! NILP (mini_window) && ! EQ (mini_window, minibuf_window) && !NILP (Fwindow_minibuffer_p (mini_window))) - Fset_window_buffer (mini_window, empty_minibuf, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (mini_window, empty_minibuf, 0, 0); } /* Display this minibuffer in the proper window. */ - Fset_window_buffer (minibuf_window, Fcurrent_buffer (), Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (minibuf_window, Fcurrent_buffer (), 0, 0); Fselect_window (minibuf_window, Qnil); XWINDOW (minibuf_window)->hscroll = 0; diff --git a/src/w32fns.c b/src/w32fns.c index d1dba0c0bb8..7779f032104 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -5237,7 +5237,9 @@ x_create_tip_frame (struct w32_display_info *dpyinfo, XSETFRAME (frame, f); buffer = Fget_buffer_create (build_string (" *tip*")); - Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (FRAME_ROOT_WINDOW (f), buffer, 0, 0); old_buffer = current_buffer; set_buffer_internal_1 (XBUFFER (buffer)); BSET (current_buffer, truncate_lines, Qnil); diff --git a/src/xfns.c b/src/xfns.c index bbc9f375340..3242af937c9 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4591,7 +4591,9 @@ x_create_tip_frame (struct x_display_info *dpyinfo, XSETFRAME (frame, f); buffer = Fget_buffer_create (build_string (" *tip*")); - Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (FRAME_ROOT_WINDOW (f), buffer, 0, 0); old_buffer = current_buffer; set_buffer_internal_1 (XBUFFER (buffer)); BSET (current_buffer, truncate_lines, Qnil); -- 2.39.2