Function: TeX-arg-index

TeX-arg-index is a byte-compiled function defined in latex.el.

Signature

(TeX-arg-index OPTIONAL &optional PROMPT &rest ARGS)

Documentation

Prompt for an index entry completing with known entries.

If OPTIONAL is non-nil, insert the resulting value as an optional argument, otherwise as a mandatory one. Use PROMPT as the prompt string. ARGS is unused.

Aliases

TeX-arg-define-index

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/latex.el
(defun TeX-arg-index (optional &optional prompt &rest _args)
  "Prompt for an index entry completing with known entries.
If OPTIONAL is non-nil, insert the resulting value as an optional
argument, otherwise as a mandatory one.  Use PROMPT as the prompt
string.  ARGS is unused."
  (let ((entry (completing-read (TeX-argument-prompt optional prompt "Key")
                                (LaTeX-index-entry-list))))
    (if (and (not (string-equal "" entry))
             (not (member (list entry) (LaTeX-index-entry-list))))
        (LaTeX-add-index-entries entry))
    (TeX-argument-insert entry optional)))