]> code.delx.au - gnu-emacs/blobdiff - src/minibuf.c
TODO update
[gnu-emacs] / src / minibuf.c
index 2cc89e75680277c79fcb07b952804a032d6a5009..2df45c573bddd0727ca263dffbcfa6326720542d 100644 (file)
@@ -1,6 +1,6 @@
 /* Minibuffer input and completion.
 
-Copyright (C) 1985-1986, 1993-201 Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1993-2013 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -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);