Function: preview-buffer-restore-internal

preview-buffer-restore-internal is a byte-compiled function defined in preview.el.

Signature

(preview-buffer-restore-internal BUFFER-MISC)

Documentation

Restore previews from BUFFER-MISC if proper.

Remove them if they have expired.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/preview.el
(defun preview-buffer-restore-internal (buffer-misc)
  "Restore previews from BUFFER-MISC if proper.
Remove them if they have expired."
  (let ((timestamp (visited-file-modtime)) tempdirlist files)
    (setq preview-parsed-counters nil)
    (when (eq 'preview (pop buffer-misc))
      (preview-get-geometry)
      (if (equal (pop buffer-misc) timestamp)
          (dolist (ovdata buffer-misc)
            (setq tempdirlist
                  (apply #'preview-reinstate-preview tempdirlist
                         timestamp ovdata)))
        (dolist (ovdata buffer-misc)
          (setq files (nth 3 ovdata))
          (condition-case nil
              (delete-file (nth 0 files))
            (file-error nil))
          (unless (member (nth 1 files) tempdirlist)
            (push (nth 1 files) tempdirlist)))
        (dolist (dir tempdirlist)
          (condition-case nil
              (delete-directory dir)
            (file-error nil)))))))