Function: TeX-read-key-val

TeX-read-key-val is a byte-compiled function defined in latex.el.

Signature

(TeX-read-key-val OPTIONAL KEY-VAL-ALIST &optional PROMPT COMPLETE PREDICATE REQUIRE-MATCH INITIAL-INPUT HIST DEF INHERIT-INPUT-METHOD)

Documentation

Prompt for keys and values in KEY-VAL-ALIST and return them.

If OPTIONAL is non-nil, indicate in the prompt that we are reading an optional argument. KEY-VAL-ALIST can be
  - A function call without arguments
  - A function object
  - A symbol returning an alist
  - An alist

Each entry of this alist is a list. The first element of each list is a string representing a key and the optional second element is a list with strings to be used as values for the key. The second element can also be a variable returning a list of strings.

PROMPT replaces the standard one where ' (k=v): ' is appended to it. If you want the full control over the prompt, set COMPLETE to non-nil and then provide a full PROMPT.

PREDICATE, REQUIRE-MATCH, INITIAL-INPUT, HIST, DEF, INHERIT-INPUT-METHOD are passed to multi-prompt-key-value, which see.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/latex.el
(defun TeX-read-key-val (optional key-val-alist &optional prompt complete
                                  predicate require-match
                                  initial-input hist def
                                  inherit-input-method)
  "Prompt for keys and values in KEY-VAL-ALIST and return them.
If OPTIONAL is non-nil, indicate in the prompt that we are
reading an optional argument.  KEY-VAL-ALIST can be
  - A function call without arguments
  - A function object
  - A symbol returning an alist
  - An alist

Each entry of this alist is a list.  The first element of each
list is a string representing a key and the optional second
element is a list with strings to be used as values for the key.
The second element can also be a variable returning a list of
strings.

PROMPT replaces the standard one where \\=' (k=v): \\=' is
appended to it.  If you want the full control over the prompt,
set COMPLETE to non-nil and then provide a full PROMPT.

PREDICATE, REQUIRE-MATCH, INITIAL-INPUT, HIST, DEF,
INHERIT-INPUT-METHOD are passed to `multi-prompt-key-value',
which see."
  (multi-prompt-key-value
   (TeX-argument-prompt optional
                        (cond ((and prompt (not complete))
                               (concat prompt " (k=v)"))
                              ((and prompt complete)
                               prompt)
                              (t nil))
                        "Options (k=v)"
                        complete)
   (cond ((and (listp key-val-alist)
               (symbolp (car key-val-alist))
               (fboundp (car key-val-alist))
               (not (eq (car key-val-alist) 'lambda)))
          (funcall (car key-val-alist)))
         ((functionp key-val-alist)
          (funcall key-val-alist))
         ((and (symbolp key-val-alist)
               (boundp key-val-alist))
          (symbol-value key-val-alist))
         ((and (listp key-val-alist)
               (listp (car key-val-alist)))
          key-val-alist)
         (t
          (error "Cannot interpret key-val-alist %S" key-val-alist)))
   predicate require-match initial-input hist def inherit-input-method))