Function: TeX-ispell-document

TeX-ispell-document is an interactive and byte-compiled function defined in tex.el.

Signature

(TeX-ispell-document NAME)

Documentation

Run ispell on all open files belonging to the current document.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex.el
(defun TeX-ispell-document (name)
  "Run ispell on all open files belonging to the current document."
  (interactive (list (TeX-master-file)))
  (if (string-equal name "")
      (setq name (TeX-master-file)))

  (let ((regexp (concat "\\`\\("
                        (mapconcat (lambda (dir)
                                     (regexp-quote
                                      (expand-file-name
                                       (file-name-as-directory dir))))
                                   (append (when (file-name-directory name)
                                             (list (file-name-directory name)))
                                           TeX-check-path)
                                   "\\|")
                        "\\).*\\("
                        (mapconcat #'regexp-quote
                                   (cons (file-name-nondirectory name)
                                         (TeX-style-list))
                                   "\\|")
                        "\\)\\.\\("
                        (mapconcat #'identity TeX-file-extensions "\\|")
                        "\\)\\'"))
        (buffers (buffer-list)))
    (while buffers
      (let* ((buffer (car buffers))
             (name (TeX-buffer-file-name buffer)))
        (setq buffers (cdr buffers))
        (when (and name (string-match regexp name))
          (save-excursion (switch-to-buffer buffer) (ispell-buffer))
          t)))))