Fselect_window (window, norecord);
}
+/* Restore the selected window WINDOW. */
+
+static void
+restore_selected_window (Lisp_Object window)
+{
+ /* FIXME: not sure what to do if WINDOW has been deleted. */
+ select_window (window, Qt);
+}
+
/* Perform the text conversion operation specified in QUERY and return
the results.
selected window. */
count = SPECPDL_INDEX ();
record_unwind_protect_excursion ();
+ record_unwind_protect (restore_selected_window, selected_window);
/* Inhibit quitting. */
specbind (Qinhibit_quit, Qt);
return false;
}
-/* Restore the selected window WINDOW. */
-
-static void
-restore_selected_window (Lisp_Object window)
-{
- /* FIXME: not sure what to do if WINDOW has been deleted. */
- select_window (window, Qt);
-}
-
/* Commit the given text in the composing region. If there is no
composing region, then insert the text after frame F's selected
window's last point instead, unless the mark is active. Finally,
/* Set the current buffer to W's. */
count = SPECPDL_INDEX ();
+
+ /* The current buffer must be saved, not merely the selected
+ window. */
+ record_unwind_protect_excursion ();
record_unwind_protect (restore_selected_window, selected_window);
XSETWINDOW (window, w);
select_window (window, Qt);
selected window. */
count = SPECPDL_INDEX ();
record_unwind_protect_excursion ();
+ record_unwind_protect (restore_selected_window, selected_window);
/* Inhibit quitting. */
specbind (Qinhibit_quit, Qt);
selected window. */
count = SPECPDL_INDEX ();
record_unwind_protect_excursion ();
+ record_unwind_protect (restore_selected_window, selected_window);
/* Inhibit quitting. */
specbind (Qinhibit_quit, Qt);