[Top][All Lists]

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

Re: Please install: Some improvements to doc-view.el

From: Juri Linkov
Subject: Re: Please install: Some improvements to doc-view.el
Date: Sun, 07 Oct 2007 02:54:57 +0300
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

> Ok, this is the thread:
>   http://thread.gmane.org/gmane.emacs.devel/31757/focus=31861
> It was taken out because the mechanism for invoking external viewers
> should be replaced by the one that Gnus already uses.  Unfortunately
> that didn't happen and no real discussion followed.

A plan was to use mailcap-related functions from Gnus with the dired-x
command-guessing user interface.  But it is unclear how to use code from
Gnus in dired.  Perhaps, by loading the `mailcap' library since it is in the
Emacs source tree.  Is adding (require 'mailcap) to dired.el a good thing?

>> But what if we use my change in `dired-view-file' and add an
>> additional test for (featurep 'doc-view)?  Then users would only be
>> asked if doc-view should be used for pdf/ps/dvi files if they required
>> it explicitly.  If they do so, we can be sure that they have the
>> needed external programs installed.
> So I'd say the solution I proposed in the paragraph above is ok.  If you
> agree, here's a patch that implements it.

I think asking a question before visiting a file is very bad thing to do.

Since doc-view-mode doesn't call an external viewer, but instead renders
the file as an image inside the Emacs buffer, I think a good solution
would be to use the same user interface as is implemented by image-mode:
by default, visiting a pdf/dvi file could display a rendered image
(which is more preferable for most users than editing them, I guess).
But if the user still wants to edit the source file or to view it as text,
then the user could type `C-c C-c'.  You could also implement
`doc-view-minor-mode' because the main mode for PS files is `ps-mode',
so this requires a minor view mode (like `image-minor-mode' for text-based
image formats).

Juri Linkov

reply via email to

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