Function: preview-walk-document

preview-walk-document is a byte-compiled function defined in preview.el.

Signature

(preview-walk-document FUNC)

Documentation

Cycle through all buffers belonging to current document.

Each buffer having the same master file as the current file has FUNC called with its current buffer being set to it.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/preview.el
(defun preview-walk-document (func)
  "Cycle through all buffers belonging to current document.
Each buffer having the same master file as the current file
has FUNC called with its current buffer being set to it."
  (let* ((buffers (buffer-list))
         (master (expand-file-name (TeX-master-file t)))
         (default-buffers (list (current-buffer)
                                (find-buffer-visiting master))))
    (while buffers
      (with-current-buffer (pop buffers)
        (when
            (or (memq (current-buffer) default-buffers)
                (and (memq major-mode '(plain-TeX-mode LaTeX-mode))
                     (or (stringp TeX-master)
                         (eq TeX-master t))
                     (string= (expand-file-name (TeX-master-file t))
                              master)))
          (funcall func))))))