Function: TeX--completion-at-point

TeX--completion-at-point is a byte-compiled function defined in tex.el.

Signature

(TeX--completion-at-point)

Documentation

(La)TeX completion at point function.

See completion-at-point-functions.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex.el
(defun TeX--completion-at-point ()
  "(La)TeX completion at point function.
See `completion-at-point-functions'."
  (let ((entry (TeX--complete-find-entry)))
    (when entry
      (if (numberp (nth 1 entry))
          (let* ((sub (nth 1 entry))
                 (begin (match-beginning sub))
                 (end (match-end sub))
                 (symbol (buffer-substring-no-properties begin end))
                 (func (nth 2 entry))
                 (list (funcall func)))
            (list begin end (all-completions symbol list)
                  :annotation-function
                  (cond ((eq func #'LaTeX-completion-label-list)
                         #'LaTeX-completion-label-annotation-function)
                        (t
                         #'TeX--completion-annotation-function))))
        ;; We intentionally don't call the fallback completion functions because
        ;; they do completion on their own and don't work too well with things
        ;; like company-mode.  And the default function `ispell-complete-word'
        ;; isn't so useful anyway.
        nil))))