unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34317: 26.1.90; Wrong unbinding order in x_consider_frame_title
@ 2019-02-04 18:49 martin rudalics
  2019-02-19  9:07 ` martin rudalics
  0 siblings, 1 reply; 10+ messages in thread
From: martin rudalics @ 2019-02-04 18:49 UTC (permalink / raw)
  To: 34317

[-- Attachment #1: Type: text/plain, Size: 513 bytes --]

The unbinding order in x_consider_frame_title is botched.  Hence,
while do_switch_frame will not resize the minibuffer window when the
frame of the title bar gets selected, it will still resize when the
old frame gets reselected in the unbind form.

The behavior can be seen with emacs -Q evaluating the following two
forms in row:

(make-frame '((minibuffer . nil)))
(y-or-n-p "\n")

The attached trivial patch cures it.  Obviously, there's no guarantee
that some other client relies on the wrong order.

martin

[-- Attachment #2: x_consider_frame_title.diff~ --]
[-- Type: text/plain, Size: 1487 bytes --]

diff --git a/src/xdisp.c b/src/xdisp.c
index 274ab8d..0d084f8 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12002,12 +12002,6 @@ static void ATTRIBUTE_FORMAT_PRINTF (1, 0)
       /* Set global variable indicating that multiple frames exist.  */
       multiple_frames = CONSP (tail);
 
-      /* Switch to the buffer of selected window of the frame.  Set up
-	 mode_line_target so that display_mode_element will output into
-	 mode_line_noprop_buf; then display the title.  */
-      record_unwind_protect (unwind_format_mode_line,
-			     format_mode_line_unwind_data
-			       (f, current_buffer, selected_window, false));
       /* select-frame calls resize_mini_window, which could resize the
 	 mini-window and by that undo the effect of this redisplay
 	 cycle wrt minibuffer and echo-area display.  Binding
@@ -12015,6 +12009,12 @@ static void ATTRIBUTE_FORMAT_PRINTF (1, 0)
 	 no-op, thus avoiding the adverse side effects.  */
       specbind (Qinhibit_redisplay, Qt);
 
+      /* Switch to the buffer of selected window of the frame.  Set up
+	 mode_line_target so that display_mode_element will output into
+	 mode_line_noprop_buf; then display the title.  */
+      record_unwind_protect (unwind_format_mode_line,
+			     format_mode_line_unwind_data
+			       (f, current_buffer, selected_window, false));
       Fselect_window (f->selected_window, Qt);
       set_buffer_internal_1
 	(XBUFFER (XWINDOW (f->selected_window)->contents));


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-03-04 10:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-04 18:49 bug#34317: 26.1.90; Wrong unbinding order in x_consider_frame_title martin rudalics
2019-02-19  9:07 ` martin rudalics
2019-02-23  9:43   ` Eli Zaretskii
2019-02-23 14:00     ` martin rudalics
2019-02-23 16:46       ` Eli Zaretskii
2019-02-24  8:43         ` martin rudalics
2019-02-24 16:08           ` Eli Zaretskii
2019-02-24 18:30             ` martin rudalics
2019-02-24 18:57               ` Eli Zaretskii
2019-03-04 10:14                 ` martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).