diff options
| author | Richard M. Stallman | 1993-08-08 19:18:26 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-08-08 19:18:26 +0000 |
| commit | 79e0df73a8c8be787754a6d6716c48bb347835c3 (patch) | |
| tree | dfb80583407e56122a055d77abbf8e542c3d2129 /lisp | |
| parent | b80f19281d0831d6a41272604cea8d15ed362eba (diff) | |
| download | emacs-79e0df73a8c8be787754a6d6716c48bb347835c3.tar.gz emacs-79e0df73a8c8be787754a6d6716c48bb347835c3.zip | |
(minibuffer-window-active-p): New function.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/subr.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index c1717f553d3..e5f4189ebcb 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -83,6 +83,19 @@ If ALL-FRAMES is neither nil nor t, stick strictly to the selected frame." | |||
| 83 | (funcall proc walk-windows-current) | 83 | (funcall proc walk-windows-current) |
| 84 | (not (eq walk-windows-current walk-windows-start)))))) | 84 | (not (eq walk-windows-current walk-windows-start)))))) |
| 85 | 85 | ||
| 86 | (defun minibuffer-window-active-p (window) | ||
| 87 | "Return t if WINDOW (a minibuffer window) is now active." | ||
| 88 | ;; nil nil means include WINDOW's frame | ||
| 89 | ;; and other frames using WINDOW as minibuffer, | ||
| 90 | ;; and include minibuffer if active. | ||
| 91 | (let ((prev (previous-window window nil nil))) | ||
| 92 | ;; If PREV equals WINDOW, WINDOW must be on a minibuffer-only frame | ||
| 93 | ;; and it's not currently being used. So return nil. | ||
| 94 | (and (not (eq window prev)) | ||
| 95 | (let ((should-be-same (next-window prev nil nil))) | ||
| 96 | ;; If next-window doesn't reverse previous-window, | ||
| 97 | ;; WINDOW must be outside the cycle specified by nil nil. | ||
| 98 | (eq should-be-same window))))) | ||
| 86 | 99 | ||
| 87 | ;;;; Keymap support. | 100 | ;;;; Keymap support. |
| 88 | 101 | ||