]> git.eshelyaron.com Git - emacs.git/commitdiff
* doc-view.el (doc-view-dvipdf-program): New variable.
authorTassilo Horn <tassilo@member.fsf.org>
Mon, 14 Apr 2008 13:18:12 +0000 (13:18 +0000)
committerTassilo Horn <tassilo@member.fsf.org>
Mon, 14 Apr 2008 13:18:12 +0000 (13:18 +0000)
(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.

lisp/ChangeLog
lisp/doc-view.el

index bd495063f65fb71cde8d87ee631de8a896cb858e..ceec579639956a5b35dbbbcee3d1eb0aaf37e7f3 100644 (file)
@@ -1,5 +1,11 @@
 2008-04-14  Tassilo Horn  <tassilo@member.fsf.org>
 
+       * 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.
+
        * doc-view.el (doc-view-start-process): Don't set
        default-directory to "~/" if the current value is valid.  This
        broke PS files that run other files in the same directory.
index 942e3521d27aed2af8635da73e3d5188b23c44b1..718040a8fabc29787194c170418480bf27c65134 100644 (file)
@@ -172,7 +172,21 @@ Higher values result in larger images."
   "Program to convert DVI files to PDF.
 
 DVI file will be converted to PDF before the resulting PDF is
-converted to PNG."
+converted to PNG.
+
+If this and `doc-view-dvipdf-program' are set,
+`doc-view-dvipdf-program' will be preferred."
+  :type 'file
+  :group 'doc-view)
+
+(defcustom doc-view-dvipdf-program (executable-find "dvipdf")
+  "Program to convert DVI files to PDF.
+
+DVI file will be converted to PDF before the resulting PDF is
+converted to PNG.
+
+If this and `doc-view-dvipdfm-program' are set,
+`doc-view-dvipdf-program' will be preferred."
   :type 'file
   :group 'doc-view)
 
@@ -509,8 +523,10 @@ Image types are symbols like `dvi', `postscript' or `pdf'."
        (cond
        ((eq type 'dvi)
         (and (doc-view-mode-p 'pdf)
-             doc-view-dvipdfm-program
-             (executable-find doc-view-dvipdfm-program)))
+             (or (and doc-view-dvipdf-program
+                      (executable-find doc-view-dvipdf-program))
+                 (and doc-view-dvipdfm-program
+                      (executable-find doc-view-dvipdfm-program)))))
        ((or (eq type 'postscript) (eq type 'ps) (eq type 'eps)
             (eq type 'pdf))
         (and doc-view-ghostscript-program
@@ -574,9 +590,16 @@ Should be invoked when the cached images aren't up-to-date."
 
 (defun doc-view-dvi->pdf (dvi pdf callback)
   "Convert DVI to PDF asynchronously and call CALLBACK when finished."
-  (doc-view-start-process "dvi->pdf" doc-view-dvipdfm-program
-                          (list "-o" pdf dvi)
-                          callback))
+  ;; Prefer dvipdf over dvipdfm, because the latter has problems if the DVI
+  ;; references and includes other PS files.
+  (if (and doc-view-dvipdf-program
+          (executable-find doc-view-dvipdf-program))
+      (doc-view-start-process "dvi->pdf" doc-view-dvipdf-program
+                           (list dvi pdf)
+                           callback)
+    (doc-view-start-process "dvi->pdf" doc-view-dvipdfm-program
+                           (list "-o" pdf dvi)
+                           callback)))
 
 
 (defun doc-view-pdf/ps->png (pdf-ps png)