Function: preview-gs-close

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

Signature

(preview-gs-close PROCESS CLOSEDATA)

Documentation

Clean up after PROCESS and set up queue accumulated in CLOSEDATA.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/preview.el
(defun preview-gs-close (process closedata)
  "Clean up after PROCESS and set up queue accumulated in CLOSEDATA."
  (setq preview-gs-queue (nconc preview-gs-queue closedata))
  (if process
      (if preview-gs-queue
          (if TeX-process-asynchronous
              (if (and (eq (process-status process) 'exit)
                       (null TeX-sentinel-function))
                  ;; Process has already finished and run sentinel
                  (progn
                    (when preview-ps-file
                      (condition-case nil
                          (preview-delete-file preview-ps-file)
                        (file-error nil)))
                    (preview-gs-restart))
                (setq TeX-sentinel-function
                      (let ((fun (if preview-parsed-pdfoutput
                                     #'preview-pdf2dsc-sentinel
                                   #'preview-gs-dvips-sentinel)))
                        (lambda (process command)
                          (funcall fun process command t)))))
            (TeX-synchronous-sentinel "Preview-DviPS" (cdr preview-gs-file)
                                      process))
        ;; pathological case: no previews although we sure thought so.
        (delete-process process)
        (unless (eq (process-status process) 'signal)
          (preview-dvips-abort)))))