Function: minibuffer-nonselected-mode

minibuffer-nonselected-mode is an interactive and byte-compiled function defined in minibuffer.el.gz.

Signature

(minibuffer-nonselected-mode &optional ARG)

Documentation

Minor mode to warn about non-selected active minibuffer window.

Use the face minibuffer-nonselected to highlight the contents of the minibuffer window when the minibuffer remains active but its window is no longer selected.

This is a global minor mode. If called interactively, toggle the Minibuffer-Nonselected mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate (default-value \=minibuffer-nonselected-mode)'.

The mode's hook is called both when the mode is enabled and when it is disabled.

Probably introduced at or before Emacs version 31.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/minibuffer.el.gz
(define-minor-mode minibuffer-nonselected-mode
  "Minor mode to warn about non-selected active minibuffer window.
Use the face `minibuffer-nonselected' to highlight the contents of the
minibuffer window when the minibuffer remains active but its window is
no longer selected."
  :global t
  :initialize #'custom-initialize-after-file-load
  :init-value t
  :version "31.1"
  (if minibuffer-nonselected-mode
      (progn
	(add-hook 'minibuffer-setup-hook #'minibuffer--nonselected-setup)
	(add-hook 'minibuffer-exit-hook #'minibuffer--nonselected-exit)
	(when (active-minibuffer-window)
	  (minibuffer--nonselected-check (selected-frame))))
    (remove-hook 'minibuffer-setup-hook #'minibuffer--nonselected-setup)
    (remove-hook 'minibuffer-exit-hook #'minibuffer--nonselected-exit)
    (remove-hook 'window-state-change-functions
		 #'minibuffer--nonselected-check)
    (when (overlayp minibuffer--nonselected-overlay)
      (delete-overlay minibuffer--nonselected-overlay))))