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: Reiner Steib
Subject: [Emacs-diffs] Changes to emacs/lisp/doc-view.el,v
Date: Sun, 25 Nov 2007 20:11:50 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Reiner Steib <rsteib>   07/11/25 20:11:49

Index: doc-view.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/doc-view.el,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- doc-view.el 16 Nov 2007 18:00:39 -0000      1.23
+++ doc-view.el 25 Nov 2007 20:11:47 -0000      1.24
@@ -456,6 +456,24 @@
       (when (not (funcall predicate item))
        (setq new-list (cons item new-list))))))
 
+;;;###autoload
+(defun doc-view-mode-p (type)
+  "Return non-nil if image type TYPE is available for `doc-view'.
+Image types are symbols like `dvi', `postscript' or `pdf'."
+  (and (display-graphic-p)
+       (image-type-available-p 'png)
+       (cond
+       ((eq type 'dvi)
+        (and (doc-view-mode-p 'pdf)
+             doc-view-dvipdfm-program
+             (executable-find doc-view-dvipdfm-program)))
+       ((or (eq type 'postscript) (eq type 'ps)
+            (eq type 'pdf))
+        (and doc-view-ghostscript-program
+             (executable-find doc-view-ghostscript-program)))
+       (t ;; unknown image type
+        nil))))
+
 ;;;; Conversion Functions
 
 (defvar doc-view-shrink-factor 1.125)




reply via email to

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