Function: doc-view-mode-p

doc-view-mode-p is an autoloaded and byte-compiled function defined in doc-view.el.gz.

Signature

(doc-view-mode-p TYPE)

Documentation

Return non-nil if document type TYPE is available for doc-view.

Document types are symbols like dvi, ps, pdf, or odf (any OpenDocument format).

Source Code

;; Defined in /usr/src/emacs/lisp/doc-view.el.gz
;;;###autoload
(defun doc-view-mode-p (type)
  "Return non-nil if document type TYPE is available for `doc-view'.
Document types are symbols like `dvi', `ps', `pdf', or `odf' (any
OpenDocument format)."
  (and (display-graphic-p)
       (image-type-available-p 'png)
       (cond
	((eq type 'dvi)
	 (and (doc-view-mode-p 'pdf)
	      (or (and doc-view-dvipdf-program
		       (executable-find doc-view-dvipdf-program))
		  (and doc-view-dvipdfm-program
		       (executable-find doc-view-dvipdfm-program)))))
	((memq type '(postscript ps eps pdf))
	 ;; FIXME: allow mupdf here
	 (and doc-view-ghostscript-program
	      (executable-find doc-view-ghostscript-program)))
	((eq type 'odf)
	 (and doc-view-odf->pdf-converter-program
	      (executable-find doc-view-odf->pdf-converter-program)
	      (doc-view-mode-p 'pdf)))
	((eq type 'djvu)
	 (executable-find "ddjvu"))
	(t ;; unknown image type
	 nil))))