Function: LaTeX-completion-label-annotation-function

LaTeX-completion-label-annotation-function is a byte-compiled function defined in latex.el.

Signature

(LaTeX-completion-label-annotation-function LABEL)

Documentation

Return context for LABEL in a TeX file.

Context is a string gathered from RefTeX. Return nil if LaTeX-label-annotation-max-length is set to 0 or RefTeX-mode is not activated. Context is stripped to the number of characters defined in LaTeX-label-annotation-max-length.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/latex.el
(defun LaTeX-completion-label-annotation-function (label)
  "Return context for LABEL in a TeX file.
Context is a string gathered from RefTeX.  Return nil if
`LaTeX-label-annotation-max-length' is set to 0 or RefTeX-mode is
not activated.  Context is stripped to the number of characters
defined in `LaTeX-label-annotation-max-length'."
  (when (and (bound-and-true-p reftex-mode)
             (> LaTeX-label-annotation-max-length 0)
             (boundp 'reftex-docstruct-symbol))
    (let ((docstruct (symbol-value reftex-docstruct-symbol))
          s)
      (and (setq s (nth 2 (assoc label docstruct)))
           (concat " "
                   (string-trim-right
                    (substring s 0 (when (>= (length s)
                                             LaTeX-label-annotation-max-length)
                                     LaTeX-label-annotation-max-length))))))))