# HG changeset patch # User Gerd Moellmann # Date 998398665 0 # Node ID a6653fe3cbb999430193b8bb00b41e2eb5c6d7e4 # Parent 671f0cfb3c3e4310d27ae12457b061728094d4d5 (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. diff -r 671f0cfb3c3e -r a6653fe3cbb9 lisp/gs.el --- a/lisp/gs.el Tue Aug 21 10:42:27 2001 +0000 +++ b/lisp/gs.el Tue Aug 21 12:57:45 2001 +0000 @@ -138,7 +138,8 @@ ((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 @@ 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)