Function: preview-gs-place

preview-gs-place is a byte-compiled function defined in preview.el.

Signature

(preview-gs-place OV SNIPPET BOX RUN-BUFFER TEMPDIR PS-FILE IMAGETYPE)

Documentation

Generate an image placeholder rendered over by Ghostscript.

This enters OV into all proper queues in order to make it render this image for real later, and returns the overlay after setting a placeholder image. SNIPPET gives the number of the snippet in question for the file to be generated. BOX is a bounding box if we already know one via TeX. RUN-BUFFER is the buffer of the TeX process, TEMPDIR is the correct copy of TeX-active-tempdir, PS-FILE is a copy of preview-ps-file, IMAGETYPE is the image type for the file extension.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/preview.el
(defun preview-gs-place (ov snippet box run-buffer tempdir ps-file _imagetype)
  "Generate an image placeholder rendered over by Ghostscript.
This enters OV into all proper queues in order to make it render
this image for real later, and returns the overlay after setting
a placeholder image.  SNIPPET gives the number of the
snippet in question for the file to be generated.
BOX is a bounding box if we already know one via TeX.
RUN-BUFFER is the buffer of the TeX process,
TEMPDIR is the correct copy of `TeX-active-tempdir',
PS-FILE is a copy of `preview-ps-file', IMAGETYPE is the image type
for the file extension."
  ;; Delete files before overwriting property.
  (preview--delete-overlay-files ov)
  (overlay-put ov 'filenames
               (unless (eq ps-file t)
                 (list
                  (preview-make-filename
                   (or ps-file
                       (format "preview.%03d" snippet))
                   tempdir))))
  (overlay-put ov 'queued
               (vector box nil snippet))

  (if-let* ((old-ov
             (and preview-leave-open-previews-visible
                  (car
                   (delq
                    nil
                    (mapcar
                     (lambda (ovr)
                       (and
                        (eq (overlay-start ovr) (overlay-start ov))
                        (overlay-get ovr 'preview-image)
                        ovr))
                     (overlays-at (overlay-start ov))))))))
      (let* ((img (overlay-get old-ov 'preview-image))
             (filename (cadr img))
             (files-oov (overlay-get old-ov 'filenames))
             (files-ov  (overlay-get ov  'filenames)))
        (when img
          (overlay-put ov 'preview-image img)
          ;; Transfer filename ownership to new overlay.  The old one
          ;; will be cleared out and its files deleted.
          (when-let* ((entry (assoc filename files-oov)))
            (overlay-put old-ov 'filenames
                         (assq-delete-all filename files-oov))
            ;; Add the filename to the current overlay instead
            ;; if it's not already there
            (unless (assoc filename files-ov)
              (overlay-put ov 'filenames
                           (cons entry files-ov))))))
    (overlay-put ov 'preview-image
                 (list (preview-icon-copy preview-nonready-icon))))

  (preview-add-urgentization #'preview-gs-urgentize ov run-buffer)
  (list ov))