71 lines
2.6 KiB
Plaintext
71 lines
2.6 KiB
Plaintext
--- preview/preview.el
|
|
+++ preview/preview.el 2010-08-11 16:57:59.429024953 +0000
|
|
@@ -682,29 +682,43 @@ Gets the usual PROCESS and STRING parame
|
|
(setq preview-gs-sequence (list 1)))
|
|
(setcdr preview-gs-sequence 1)
|
|
(let* ((process-connection-type nil)
|
|
- (outfile (format "-dOutputFile=%s"
|
|
- (preview-ps-quote-filename
|
|
+ (file (if (consp (car preview-ps-file))
|
|
+ (if (consp (caar preview-ps-file))
|
|
+ (car (last (caar preview-ps-file)))
|
|
+ (caar preview-ps-file))
|
|
+ (car preview-ps-file)))
|
|
+ (outfile (format "-sOutputFile=%s"
|
|
(format "%s/pr%d-%%d.%s"
|
|
(car TeX-active-tempdir)
|
|
(car preview-gs-sequence)
|
|
- preview-gs-image-type))))
|
|
+ preview-gs-image-type)))
|
|
+ (command-line
|
|
+ (append
|
|
+ ; First replace SAFER by DELAYSAFER, we then allow reading
|
|
+ ; the preview file and after this switch over to SAFER mode
|
|
+ ; by using the .locksafe operator
|
|
+ (list "-dDELAYSAFER")
|
|
+ (remove "-dSAFER" preview-gs-command-line)
|
|
+ (list "-c"
|
|
+ (format "<</PermitFileReading[%s]>> setuserparams .locksafe"
|
|
+ (preview-ps-quote-filename file t)))))
|
|
(process
|
|
(apply #'start-process
|
|
"Preview-Ghostscript"
|
|
(current-buffer)
|
|
preview-gs-command
|
|
outfile
|
|
- preview-gs-command-line)))
|
|
+ command-line)))
|
|
(goto-char (point-max))
|
|
(insert-before-markers "Running `Preview-Ghostscript' with ``"
|
|
(mapconcat #'shell-quote-argument
|
|
(append
|
|
(list preview-gs-command
|
|
outfile)
|
|
- preview-gs-command-line)
|
|
+ command-line)
|
|
" ") "''\n")
|
|
(setq preview-gs-answer "")
|
|
- (process-kill-without-query process)
|
|
+ (set-process-query-on-exit-flag process nil)
|
|
(set-process-sentinel process #'preview-gs-sentinel)
|
|
(set-process-filter process #'preview-gs-filter)
|
|
(process-send-string process preview-gs-init-string)
|
|
@@ -1075,7 +1089,7 @@ NONREL is not NIL."
|
|
(setq preview-gs-init-string
|
|
(concat preview-gs-init-string
|
|
(format "[%s(r)file]aload exch %s .runandhide aload pop "
|
|
- (preview-ps-quote-filename file)
|
|
+ (preview-ps-quote-filename file t)
|
|
(preview-gs-dsc-cvx 0 preview-gs-dsc))))))
|
|
|
|
(defun preview-gs-urgentize (ov buff)
|
|
@@ -1163,7 +1177,7 @@ Try \\[ps-shell] and \\[ps-execute-buffe
|
|
"Make an eps error flag in overlay OV for ERR string."
|
|
(let* ((filenames (overlay-get ov 'filenames))
|
|
(file (car (nth 0 filenames)))
|
|
- (outfile (format "-dOutputFile=%s"
|
|
+ (outfile (format "-sOutputFile=%s"
|
|
(preview-ps-quote-filename
|
|
(car (nth 1 filenames)))))
|
|
(ps-open
|