Function: help--symbol-completion-table

help--symbol-completion-table is a byte-compiled function defined in help-fns.el.gz.

Signature

(help--symbol-completion-table STRING PRED ACTION)

Source Code

;; Defined in /usr/src/emacs/lisp/help-fns.el.gz
(defun help--symbol-completion-table (string pred action)
  (if (eq action 'metadata)
      `(metadata
        ,@(when completions-detailed
            '((affixation-function . help--symbol-completion-table-affixation)))
        (category . symbol-help))
    (when (and help-enable-completion-autoload
               (memq action '(nil t lambda)))
      (let ((prefixes (radix-tree-prefixes (help-definition-prefixes) string)))
        ;; Don't load FOO.el during `test-completion' of `FOO-'.
        (unless (and (eq action 'lambda) (assoc string prefixes))
          (help--load-prefixes prefixes))))
    (let ((prefix-completions
           (and help-enable-completion-autoload
                ;; For `all-completions' and `try-completion', consider
                ;; `definition-prefixes' as valid completions, to help users
                ;; complete the input to the point where the above
                ;; `help-enable-completion-autoload' code can take over.
                ;; But don't do it for other operations, like `test-completion'
                ;; (bug#80873).
                (memq action '(nil t))
                (mapcar #'intern (all-completions string
                                                  definition-prefixes)))))
      (complete-with-action action obarray string
                            (if pred (lambda (sym)
                                       (or (funcall pred sym)
                                           (memq sym prefix-completions))))))))