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

Re: View PDF, PS within emacs



>>>>> In [emacs-w3m : No.10039] Katsumi Yamaoka wrote:

> I've improved the `doc-view-mode' support for emacs-w3m.  A patch
> for the CVS trunk is below.  It works asynchronously and requires
> no temp file.

I've installed that version of the `doc-view-mode' support in
the emacs-w3m CVS trunk.

> In this version, the new `w3m-use-doc-view-mode' variable controls
> whether to use the `doc-view-mode'.
> ,----
>| w3m-use-doc-view-mode is a variable defined in `w3m.elc'.

Now the variable name is `w3m-doc-view-content-types'.

>| Its value is
>| ("application/dvi" "application/postscript" "application/pdf")
>|
>| Documentation:
>| List of content types for which to use `doc-view-mode' to view contents.
>| This overrides `w3m-content-type-alist'.
> `----

> For remote files, the content type of a file is compared with
> the value of this variable after retrieving the contents.  And
> the file is displayed using `doc-view-mode' if its content type
> matches one of the value.

> But it can be altered to the way letting `w3m-content-type-alist'
> control whether to use the `doc-view-mode'.  Which do you think
> to be good?

I tried this way too, but reached to the conclusion that it is
hard to implement a convenient way to switch `doc-view-mode' and
the external viewers.

> On the other hand, for local files (e.g. file:///dir/file.pdf)
> `auto-mode-alist' controls how to display them, because they
> will be open by a `find-file-*' function which is the default
> value of `w3m-local-find-file-function'.

> (I noticed there is no way to view file:///dir/file.pdf using
> the external viewer such as acroread.  Oops!)

It can be done by modifying the `w3m-local-find-file-regexps'
variable into the following for example:

(setq w3m-local-find-file-regexps
      '(nil . "\\.\\(?:[sx]?html?\\|dvi\\|ps\\|pdf\\)\\'"))

Regards,