diff options
author | Gerd Moellmann <gerd@gnu.org> | 2001-08-21 12:58:07 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2001-08-21 12:58:07 +0000 |
commit | e98c601b3eac52367a9ce766957b88eeb39218b1 (patch) | |
tree | 916f21a9852da151fc1a5df51228467c92191628 /lisp/gs.el | |
parent | 859ea4b849c26f2358bfae8d5b9772b965157831 (diff) | |
download | emacs-e98c601b3eac52367a9ce766957b88eeb39218b1.tar.gz |
(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.
Diffstat (limited to 'lisp/gs.el')
-rw-r--r-- | lisp/gs.el | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/gs.el b/lisp/gs.el index 1399e4258a9..7f5aaadc2a8 100644 --- a/lisp/gs.el +++ b/lisp/gs.el @@ -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) |