Function: command-completion-using-modes-p

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

Signature

(command-completion-using-modes-p SYMBOL BUFFER)

Documentation

Say whether SYMBOL has been marked as a mode-specific command in BUFFER.

Source Code

;; Defined in /usr/src/emacs/lisp/simple.el.gz
(defun command-completion-using-modes-p (symbol buffer)
  "Say whether SYMBOL has been marked as a mode-specific command in BUFFER."
  ;; Check the modes.
  (when-let ((modes (command-modes symbol)))
    ;; Common fast case: Just a single mode.
    (if (null (cdr modes))
        (or (provided-mode-derived-p
             (buffer-local-value 'major-mode buffer) (car modes))
            (memq (car modes)
                  (buffer-local-value 'local-minor-modes buffer))
            (memq (car modes) global-minor-modes))
      ;; Uncommon case: Multiple modes.
      (command-completion-with-modes-p modes buffer))))