aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTassilo Horn2008-04-14 13:18:12 +0000
committerTassilo Horn2008-04-14 13:18:12 +0000
commit53d4c024e9407cfc884005f9c969f7488bc3ec99 (patch)
tree1fa6e737e6b631754a953a0e166d36c3335a8f4a
parent3c03f2cef091f5fc2664248fb16074d2d95dde0f (diff)
downloademacs-53d4c024e9407cfc884005f9c969f7488bc3ec99.tar.gz
emacs-53d4c024e9407cfc884005f9c969f7488bc3ec99.zip
* doc-view.el (doc-view-dvipdf-program): New variable.
(doc-view-dvipdfm-program): Mention doc-view-dvipdf-program. (doc-view-mode-p): Check for doc-view-dvipdf-program as alternative for doc-view-dvipdfm-program. (doc-view-dvi->pdf): Prefer dvipdf over dvipdfm.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/doc-view.el35
2 files changed, 35 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bd495063f65..ceec5796399 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
12008-04-14 Tassilo Horn <tassilo@member.fsf.org> 12008-04-14 Tassilo Horn <tassilo@member.fsf.org>
2 2
3 * doc-view.el (doc-view-dvipdf-program): New variable.
4 (doc-view-dvipdfm-program): Mention doc-view-dvipdf-program.
5 (doc-view-mode-p): Check for doc-view-dvipdf-program as
6 alternative for doc-view-dvipdfm-program.
7 (doc-view-dvi->pdf): Prefer dvipdf over dvipdfm.
8
3 * doc-view.el (doc-view-start-process): Don't set 9 * doc-view.el (doc-view-start-process): Don't set
4 default-directory to "~/" if the current value is valid. This 10 default-directory to "~/" if the current value is valid. This
5 broke PS files that run other files in the same directory. 11 broke PS files that run other files in the same directory.
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 942e3521d27..718040a8fab 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -172,7 +172,21 @@ Higher values result in larger images."
172 "Program to convert DVI files to PDF. 172 "Program to convert DVI files to PDF.
173 173
174DVI file will be converted to PDF before the resulting PDF is 174DVI file will be converted to PDF before the resulting PDF is
175converted to PNG." 175converted to PNG.
176
177If this and `doc-view-dvipdf-program' are set,
178`doc-view-dvipdf-program' will be preferred."
179 :type 'file
180 :group 'doc-view)
181
182(defcustom doc-view-dvipdf-program (executable-find "dvipdf")
183 "Program to convert DVI files to PDF.
184
185DVI file will be converted to PDF before the resulting PDF is
186converted to PNG.
187
188If this and `doc-view-dvipdfm-program' are set,
189`doc-view-dvipdf-program' will be preferred."
176 :type 'file 190 :type 'file
177 :group 'doc-view) 191 :group 'doc-view)
178 192
@@ -509,8 +523,10 @@ Image types are symbols like `dvi', `postscript' or `pdf'."
509 (cond 523 (cond
510 ((eq type 'dvi) 524 ((eq type 'dvi)
511 (and (doc-view-mode-p 'pdf) 525 (and (doc-view-mode-p 'pdf)
512 doc-view-dvipdfm-program 526 (or (and doc-view-dvipdf-program
513 (executable-find doc-view-dvipdfm-program))) 527 (executable-find doc-view-dvipdf-program))
528 (and doc-view-dvipdfm-program
529 (executable-find doc-view-dvipdfm-program)))))
514 ((or (eq type 'postscript) (eq type 'ps) (eq type 'eps) 530 ((or (eq type 'postscript) (eq type 'ps) (eq type 'eps)
515 (eq type 'pdf)) 531 (eq type 'pdf))
516 (and doc-view-ghostscript-program 532 (and doc-view-ghostscript-program
@@ -574,9 +590,16 @@ Should be invoked when the cached images aren't up-to-date."
574 590
575(defun doc-view-dvi->pdf (dvi pdf callback) 591(defun doc-view-dvi->pdf (dvi pdf callback)
576 "Convert DVI to PDF asynchronously and call CALLBACK when finished." 592 "Convert DVI to PDF asynchronously and call CALLBACK when finished."
577 (doc-view-start-process "dvi->pdf" doc-view-dvipdfm-program 593 ;; Prefer dvipdf over dvipdfm, because the latter has problems if the DVI
578 (list "-o" pdf dvi) 594 ;; references and includes other PS files.
579 callback)) 595 (if (and doc-view-dvipdf-program
596 (executable-find doc-view-dvipdf-program))
597 (doc-view-start-process "dvi->pdf" doc-view-dvipdf-program
598 (list dvi pdf)
599 callback)
600 (doc-view-start-process "dvi->pdf" doc-view-dvipdfm-program
601 (list "-o" pdf dvi)
602 callback)))
580 603
581 604
582(defun doc-view-pdf/ps->png (pdf-ps png) 605(defun doc-view-pdf/ps->png (pdf-ps png)