Function: TeX-arg-file-name-sans-extension

TeX-arg-file-name-sans-extension is a byte-compiled function defined in latex.el.

Signature

(TeX-arg-file-name-sans-extension OPTIONAL &optional PROMPT)

Documentation

Prompt for a file name.

Initial input is the name of the file being visited in the current buffer, without extension. If OPTIONAL is non-nil, insert it as an optional argument. Use PROMPT as the prompt string.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/latex.el
(defun TeX-arg-file-name-sans-extension (optional &optional prompt)
  "Prompt for a file name.
Initial input is the name of the file being visited in the
current buffer, without extension.  If OPTIONAL is non-nil,
insert it as an optional argument.  Use PROMPT as the prompt
string."
  (let ((name (file-name-sans-extension
               (file-name-nondirectory (TeX-buffer-file-name)))))
    (TeX-argument-insert
     (TeX-read-string
      (TeX-argument-prompt optional
                           (when prompt
                             (if optional
                                 prompt
                               (format (concat prompt " (default %s)") name)))
                           (if optional
                               "Name"
                             (format "Name (default %s)" name)))
      nil nil (if optional nil name))
     optional)))