Function: TeX-arg-string

TeX-arg-string is a byte-compiled function defined in tex.el.

Signature

(TeX-arg-string OPTIONAL &optional PROMPT INITIAL-INPUT HISTORY DEFAULT-VALUE LEFTBRACE RIGHTBRACE)

Documentation

Prompt for a string.

If OPTIONAL is not nil then the PROMPT will start with `(Optional) '. INITIAL-INPUT is a string to insert before reading input.

HISTORY and DEFAULT-VALUE are ultimately passed to read-string, which see.

The brackets used are controlled by the string values of LEFTBRACE and RIGHTBRACE.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.2.0/tex.el
(defun TeX-arg-string (optional &optional prompt initial-input
                                history default-value
                                leftbrace rightbrace)
  "Prompt for a string.

If OPTIONAL is not nil then the PROMPT will start with ``(Optional) ''.
INITIAL-INPUT is a string to insert before reading input.

HISTORY and DEFAULT-VALUE are ultimately passed to `read-string',
which see.

The brackets used are controlled by the string values of
LEFTBRACE and RIGHTBRACE."
  (let ((TeX-arg-opening-brace (or leftbrace TeX-arg-opening-brace))
        (TeX-arg-closing-brace (or rightbrace TeX-arg-closing-brace)))
    (TeX-argument-insert
     (if (and (not optional) (TeX-active-mark))
         (let ((TeX-argument (buffer-substring (point) (mark))))
           (delete-region (point) (mark))
           TeX-argument)
       (TeX-read-string (TeX-argument-prompt
                         optional
                         (if (and prompt default-value)
                             (concat prompt " (default " default-value ")")
                           prompt)
                         (concat "Text" (when default-value
                                          (concat " (default " default-value ")"))))
                        initial-input history default-value))
     optional)))