From: Reiner Steib Date: Sun, 25 Nov 2007 20:11:47 +0000 (+0000) Subject: (doc-view-mode-p): New function. X-Git-Tag: emacs-pretest-23.0.90~9470 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=789ab9d4af1a8ec69b01c642d19e74e7f488442b;p=emacs.git (doc-view-mode-p): New function. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index db636333826..8cdee883b82 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-11-25 Reiner Steib + + * doc-view.el (doc-view-mode-p): New function. + 2007-11-25 Dan Nicolaescu * mail/mspools.el (rmail-get-new-mail): diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 5443bc3672e..d0515fffe70 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -456,6 +456,24 @@ It's a subdirectory of `doc-view-cache-directory'." (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)