# HG changeset patch # User Kim F. Storm # Date 1015026612 0 # Node ID a38ac87b3085619ffc37031c931eba65e689de6d # Parent e509f67e2ca5b18531b72b13968e9c36c417de5c (Fminibuffer_selected_window): New function. (syms_of_window): Defsubr it. diff -r e509f67e2ca5 -r a38ac87b3085 src/window.c --- a/src/window.c Fri Mar 01 23:49:27 2002 +0000 +++ b/src/window.c Fri Mar 01 23:50:12 2002 +0000 @@ -4549,6 +4549,20 @@ return result; } +DEFUN ("minibuffer-selected-window", Fminibuffer_selected_window, Sminibuffer_selected_window, 0, 0, 0, + doc: /* Return the window which was selected when entering the minibuffer. +Returns nil, if current window is not a minibuffer window. */) + () +{ + if (minibuf_level > 0 + && MINI_WINDOW_P (XWINDOW (selected_window)) + && !NILP (minibuf_selected_window) + && WINDOW_LIVE_P (minibuf_selected_window)) + return minibuf_selected_window; + + return Qnil; +} + /* Value is the number of lines actually displayed in window W, as opposed to its height. */ @@ -6012,6 +6026,7 @@ defsubr (&Sscroll_right); defsubr (&Sother_window_for_scrolling); defsubr (&Sscroll_other_window); + defsubr (&Sminibuffer_selected_window); defsubr (&Srecenter); defsubr (&Swindow_text_height); defsubr (&Smove_to_window_line);