emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/doc-view.el,v


From: Tassilo Horn
Subject: [Emacs-diffs] Changes to emacs/lisp/doc-view.el,v
Date: Mon, 14 Apr 2008 13:17:42 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Tassilo Horn <tsdh>     08/04/14 13:17:41

Index: doc-view.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/doc-view.el,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- doc-view.el 14 Apr 2008 11:02:03 -0000      1.62
+++ doc-view.el 14 Apr 2008 13:17:40 -0000      1.63
@@ -172,7 +172,21 @@
   "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 @@
        (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 @@
 
 (defun doc-view-dvi->pdf (dvi pdf callback)
   "Convert DVI to PDF asynchronously and call CALLBACK when finished."
+  ;; 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))
+                           callback)))
 
 
 (defun doc-view-pdf/ps->png (pdf-ps png)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]