Function: command-completion-with-modes-p

command-completion-with-modes-p is a byte-compiled function defined in simple.el.gz.

Signature

(command-completion-with-modes-p MODES BUFFER)

Documentation

Say whether MODES are in action in BUFFER.

This is the case if either the major mode is derived from one of MODES, or (if one of MODES is a minor mode), if it is switched on in BUFFER.

Source Code

;; Defined in /usr/src/emacs/lisp/simple.el.gz
(defun command-completion-with-modes-p (modes buffer)
  "Say whether MODES are in action in BUFFER.
This is the case if either the major mode is derived from one of MODES,
or (if one of MODES is a minor mode), if it is switched on in BUFFER."
  (or (provided-mode-derived-p (buffer-local-value 'major-mode buffer) modes)
      ;; It's a minor mode.
      (seq-intersection modes
                        (buffer-local-value 'local-minor-modes buffer)
                        #'eq)
      (seq-intersection modes global-minor-modes #'eq)))