emacs-devel
[Top][All Lists]
Advanced

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

Re: doc-view and mailcap


From: Reiner Steib
Subject: Re: doc-view and mailcap
Date: Sun, 25 Nov 2007 23:53:49 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

On Thu, Oct 18 2007, Reiner Steib wrote:

> On Thu, Oct 18 2007, Juri Linkov wrote:
[...]
>>> (defun doc-view-mode-p ()
>>>   (and (display-graphic-p)
>
> Maybe an additional test like "(executable-find
> doc-view-ghostscript-program)" would be useful here.
>
>>>        (image-type-available-p 'png)))
>>>
>>> Shouldn't it?
>>
>> I think the second variant is better.  Since this is a matter of doc-view
>> to decide if it can support displaying, it should have such a function
>> (autoloaded).
>
> I agree.  

Committed:

(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))))

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




reply via email to

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