Function: command-completion-default-include-p

command-completion-default-include-p is a byte-compiled function defined in simple.el.gz.

Signature

(command-completion-default-include-p SYMBOL BUFFER)

Documentation

Say whether SYMBOL should be offered as a completion.

If there's a completion-predicate for SYMBOL, the result from calling that predicate is called. If there isn't one, this predicate is true if the command SYMBOL is applicable to the major mode in BUFFER, or any of the active minor modes in BUFFER.

View in manual

Probably introduced at or before Emacs version 28.1.

Source Code

;; Defined in /usr/src/emacs/lisp/simple.el.gz
(defun command-completion-default-include-p (symbol buffer)
  "Say whether SYMBOL should be offered as a completion.
If there's a `completion-predicate' for SYMBOL, the result from
calling that predicate is called.  If there isn't one, this
predicate is true if the command SYMBOL is applicable to the
major mode in BUFFER, or any of the active minor modes in
BUFFER."
  (if (get symbol 'completion-predicate)
      ;; An explicit completion predicate takes precedence.
      (funcall (get symbol 'completion-predicate) symbol buffer)
    (or (null (command-modes symbol))
        (command-completion-using-modes-p symbol buffer))))