]> git.eshelyaron.com Git - emacs.git/commitdiff
(gs-set-ghostview-colors-window-prop): Call
authorGerd Moellmann <gerd@gnu.org>
Tue, 21 Aug 2001 12:58:07 +0000 (12:58 +0000)
committerGerd Moellmann <gerd@gnu.org>
Tue, 21 Aug 2001 12:58:07 +0000 (12:58 +0000)
x-change-window-property with 3rd arg FRAME.
(gs-load-image): Wait for a previoius Ghostscript process
to complete before starting a new one.

lisp/ChangeLog
lisp/gs.el

index 40eef086a4e2ff33bcdddfd9e6ceaf6c5490ca68..7dc88be3fc883df71520dc8893a6553880db8fe3 100644 (file)
@@ -1,5 +1,10 @@
 2001-08-21  Gerd Moellmann  <gerd@gnu.org>
 
+       * gs.el (gs-set-ghostview-colors-window-prop): Call
+       x-change-window-property with 3rd arg FRAME.
+       (gs-load-image): Wait for a previoius Ghostscript process
+       to complete before starting a new one.
+
        * image.el (image-type-regexps): Make sure that the TIFF
        pattern is only matched at the beginning of a string.
        From Markus Rost <rost@math.ohio-state.edu>.
index 1399e4258a9d7cb9b4af0d32f2daf2e9c085375d..7f5aaadc2a81876fcd2124934af63353b5b30cff 100644 (file)
@@ -138,7 +138,8 @@ image in pixels."
                    ((x-display-grayscale-p frame) "Grayscale")
                    (t "Monochrome"))))
     (x-change-window-property "GHOSTVIEW_COLORS"
-                             (format "%s %s" mode pixel-colors))))
+                             (format "%s %s" mode pixel-colors)
+                             frame)))
 
 
 ;
@@ -151,7 +152,16 @@ and height of the image in pixels.  WINDOW-AND-PIXMAP-ID is a string of
 the form \"WINDOW-ID PIXMAP-ID\".  Value is non-nil if successful."
   (unwind-protect
       (let ((file (plist-get (cdr spec) :file))
-           gs)
+           gs
+           (waiting 0))
+       ;; If another ghostscript is running, wait for it to complete.
+       ;; Two ghostscript processes running at the same time would
+       ;; use the same window properties, and get confused.
+       (while (and (process-status "gs") (< waiting 10))
+         (sit-for 0 100 t)
+         (setq waiting (1+ waiting)))
+       (when (process-status "gs")
+         (kill-process "gs"))
        (gs-set-ghostview-window-prop frame spec img-width img-height)
        (gs-set-ghostview-colors-window-prop frame pixel-colors)
        (setenv "GHOSTVIEW" window-and-pixmap-id)