Install fixes for Bug#12764 and Bug#12766.
authorMartin Rudalics <rudalics@gmx.at>
Wed, 31 Oct 2012 10:02:51 +0000 (11:02 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Wed, 31 Oct 2012 10:02:51 +0000 (11:02 +0100)
* window.el (quit-restore-window): If the window has been
created on an existing frame and ended up as the sole window on
that frame, do not delete it (Bug#12764).

* minibuf.c (read_minibuf): Restore current buffer since
choose_minibuf_frame calling Fset_frame_selected_window may
change it (Bug#12766).

lisp/ChangeLog
lisp/window.el
src/ChangeLog
src/minibuf.c

index 88ea199..dc928c3 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-31  Martin Rudalics  <rudalics@gmx.at>
+
+       * window.el (quit-restore-window): If the window has been
+       created on an existing frame and ended up as the sole window on
+       that frame, do not delete it (Bug#12764).
+
 2012-10-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/sh-script.el (sh--inside-noncommand-expression):
index bd04339..10f75d4 100644 (file)
@@ -3556,7 +3556,12 @@ the buffer of WINDOW.  The following values are handled:
         quad entry)
     (cond
      ((and (not prev-buffer)
-          (memq (nth 1 quit-restore) '(window frame))
+          (or (eq (nth 1 quit-restore) 'frame)
+              (and (eq (nth 1 quit-restore) 'window)
+                   ;; If the window has been created on an existing
+                   ;; frame and ended up as the sole window on that
+                   ;; frame, do not delete it (Bug#12764).
+                   (not (eq window (frame-root-window window)))))
           (eq (nth 3 quit-restore) buffer)
           ;; Delete WINDOW if possible.
           (window--delete window nil (eq bury-or-kill 'kill)))
index 1ae99a2..3ad653e 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-31  Martin Rudalics  <rudalics@gmx.at>
+
+       * minibuf.c (read_minibuf): Restore current buffer since
+       choose_minibuf_frame calling Fset_frame_selected_window may
+       change it (Bug#12766).
+
 2012-10-30  Jan Djärv  <jan.h.d@swipnet.se>
 
        * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
index 2cc89e7..dcc4af3 100644 (file)
@@ -472,6 +472,10 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
 
   /* Choose the minibuffer window and frame, and take action on them.  */
 
+  /* Prepare for restoring the current buffer since choose_minibuf_frame
+     calling Fset_frame_selected_window may change it (Bug#12766).  */
+  record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+
   choose_minibuf_frame ();
 
   record_unwind_protect (choose_minibuf_frame_1, Qnil);