1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

(minibuffer-window-active-p): New function.

This commit is contained in:
Richard M. Stallman 1993-08-08 19:18:26 +00:00
parent b80f19281d
commit 79e0df73a8

View file

@ -83,6 +83,19 @@ If ALL-FRAMES is neither nil nor t, stick strictly to the selected frame."
(funcall proc walk-windows-current)
(not (eq walk-windows-current walk-windows-start))))))
(defun minibuffer-window-active-p (window)
"Return t if WINDOW (a minibuffer window) is now active."
;; nil nil means include WINDOW's frame
;; and other frames using WINDOW as minibuffer,
;; and include minibuffer if active.
(let ((prev (previous-window window nil nil)))
;; If PREV equals WINDOW, WINDOW must be on a minibuffer-only frame
;; and it's not currently being used. So return nil.
(and (not (eq window prev))
(let ((should-be-same (next-window prev nil nil)))
;; If next-window doesn't reverse previous-window,
;; WINDOW must be outside the cycle specified by nil nil.
(eq should-be-same window)))))
;;;; Keymap support.