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

Re: View PDF, PS within emacs

On Tue, 26 Feb 2008 20:00:43 +0900 Katsumi Yamaoka wrote:

>>>>>> In [emacs-w3m : No.10033] David Hansen wrote:
>>> I guess we need a Lisp function that downloads the contents into a
>>> local file and performs `find-file' on it if `auto-mode-alist'
>>> contains the `doc-view-mode' element.
>> Ah, OK, I naively thought we just put the file content in a buffer and
>> then run the `doc-view-mode' command, but it seems that doc-view
>> requires an existing file.
> It might be better to implement `doc-view-buffer' in the Emacs
> trunk first. ;-)
>>> But it might be somewhat troublesome to make emacs-w3m work for a Lisp
>>> function (not an external command) which is specified in
>>> `w3m-content-type-alist'.
>> I think there already is one entry that calls a lisp function (one of
>> the browse-url functions for `w3m-view-url-with-external-browser').
> I see.  But the functions in `w3m-content-type-alist' might not
> be for the internal display.  Instead, now I think modifying
> `w3m-goto-url' (as well as it handles ftp, local files, etc.) is
> reasonable.  Tsuchiya-san might dislike it, though.
> I tried a quick hack.  It works, however it has to be much improved.

What about introducing some new variable then for files that should be
displayed internally but not by w3m?  This would be useful for emacs
lisp files and other scripts too (it's not a big problem there, I
usually just run the major-mode command manually, but would be nice if
it happens automatically).

Note that we would need the file extension and a list of MIME types, or
at least a regexp.  E.g. some servers serve a .pl file as "text/plain",
some as something exotic like "text/x-perl".