[Top][All Lists]

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

Re: Viewing PDFs as text?

From: Tassilo Horn
Subject: Re: Viewing PDFs as text?
Date: Tue, 27 Jan 2009 10:33:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

"Roland Winkler" <address@hidden> writes:

> On Mon Jan 26 2009 Tassilo Horn wrote:
>> Samuel Wales <address@hidden> writes:
>> >> `C-c C-t' once to get the pure text contents, right? ;-)
>> >
>> > Please explain?  This works for the 3 use cases of w3m, ido, and org
>> > invocations?
>> No, no.  Only for pdf/ps/dvi files with emacs 23.  There you can do
>>   C-x C-f /path/to/file RET
>> which openes the file with doc-view, and `C-c C-t' will open a buffer
>> with the plain text contents then.
> Somehow I am missing the point. How is this supposed to work from
> within something like emacs-w3m when I have only a tty?

Emacs-w3m issues

  (find-file "file-or-url")

and if it is a PDF/DVI/PS, it'll be opened with doc-view.  If you are on
a tty then you cannot see the image but the pdf contents, which is not
really useful.  But with C-c C-t you'll get a new buffer with just the
plain text contents.

> Currently, to the best of my knowledge, emacs-w3m doesn't know what to
> do with pdf files when emacs 23 is running in a tty.  I still don't
> see why doc-view should not handle this, even if it gives only a
> minimalistic set of features. Of course, one could incorporate such a
> feature also into emacs-w3m itself. But that appears to be the wrong
> place to me. (The next package dealing with pdf files similar to
> emacs-w3m would have to reinvent the wheel.)

The right thing to to would be to modify `auto-mode-alist' and
`find-file' to allow the former to contain predicates, like:

  (if window-system

where externally would mean use the systems default external

Then this behavior is centralized and not each mode which needs some
feature has to handle it itself.


reply via email to

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