Function: desktop-buffer-preview-misc-data

desktop-buffer-preview-misc-data is a byte-compiled function defined in preview.el.

Signature

(desktop-buffer-preview-misc-data &rest IGNORED)

Documentation

Hook function that extracts previews for persistent sessions.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/preview.el
(defun desktop-buffer-preview-misc-data (&rest _ignored)
  "Hook function that extracts previews for persistent sessions."
  (unless (buffer-modified-p)
    (setq preview-last-counter nil)
    (save-restriction
      (widen)
      (let (save-info (timestamp (visited-file-modtime)))
        (dolist (ov (sort (overlays-in (point-min) (point-max))
                          (lambda (x y) (< (overlay-start x)
                                           (overlay-start y)))))
          (when (and (memq (overlay-get ov 'preview-state) '(active inactive))
                     (null (overlay-get ov 'queued))
                     (cdr (overlay-get ov 'preview-image)))
            (push (preview-dissect ov timestamp) save-info)))
        (and save-info
             (cons 'preview (cons timestamp (nreverse save-info))))))))