help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to preview HTML inside emacs?


From: Thierry Volpiatto
Subject: Re: How to preview HTML inside emacs?
Date: Thu, 10 Jan 2008 21:17:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

"Forrest Y. Yu" <forrest.yu@gmail.com> writes:

> On Jan 10, 2008 4:10 PM, Thierry Volpiatto <thierry.volpiatto@gmail.com>
> wrote:
>>
>> "Forrest Y. Yu" <forrest.yu@gmail.com> writes:
>>
>> > hi Everyone,
>> >
>> > I'm using emacs to edit HTML files, can I preview them inside the emacs
>> > without opening any external browser?
>> >
>> > `C-c C-v' is not good for me, 'coz it brings a firefox window in X and
>> > doesn't work in console.
>>
>> I use that and it's work fine:
>
> I'm sorry but, how can I make use of it?
> I added these two lines into my ~/.emacs:
> (require 'extview)
> (push '("\\.html$" . "w3m %s") extview-application-associations)
>
> then I press `C-c C-v' when editing a html file, it still brings a firefox
> window!

Sorry i understand preview as seeing the sourcecode of the file. 
May be better using another command as: 

w3m-find-file your_html_file ==> bind it to some keys

Extview use ~/.mailcap to manage your file extensions, so if you modify
your ~/.mailcap, all the .html will be open in w3m.
It's may be not what you want.

Extview , when you press enter while in dired, ask you if you want to
open the file in an external viewer or not.

Here is how to configure extview:(my config)

(add-to-list 'load-path "~/elisp/extview")
(load "extview.elc")
(push '("\\.py$" . nil) extview-application-associations)
(push '("\\.sh$" . nil) extview-application-associations)
(push '("\\.py~$" . nil) extview-application-associations)
(push '("\\.sh~$" . nil) extview-application-associations)
(push '("\\.html$" . ask) extview-application-associations)
(push '("\\.jpeg$" . nil) extview-application-associations)
(push '("\\.jpg$" . nil) extview-application-associations)
(push '("\\.png$" . nil) extview-application-associations)
(push '("\\.gif$" . nil) extview-application-associations)
(push '("\\.tiff$" . nil) extview-application-associations)
(push '("\\.ogg$" . nil) extview-application-associations)
(push '("\\.mp3$" . nil) extview-application-associations)
(push '("\\.wav$" . nil) extview-application-associations)
(push '("\\.m3u$" . nil) extview-application-associations)
(push '("\\.tcl$" . nil) extview-application-associations)
(push '("\\.pls$" . nil) extview-application-associations)
(push '("\\.tex$" . nil) extview-application-associations)
(push '("\\.ps$" . nil) extview-application-associations)
(push '("\\.css$" . nil) extview-application-associations)
(push '("\\.xml$" . ask) extview-application-associations)
(push '("\\.ps$" . ask) extview-application-associations)
(push '("\\.*~$" . nil) extview-application-associations)
(push '("\\.*.~*~$" . nil) extview-application-associations)
(push '("\\.h$" . nil) extview-application-associations)
(push '("\\.d$" . nil) extview-application-associations)
(push '("\\.dat$" . nil) extview-application-associations)

Here is my ~/.mailcap:(where extview read)

image/jpeg; showpicture -viewer display %s
image/*; showpicture -viewer display %s
text/html; firefox %s
application/xml; firefox %s
text/xml; firefox %s
text/plain ; $EDITOR %s
text/* ; $EDITOR %s
chemical/x-mopac-input ; $EDITOR %s
application/pdf; evince %s
application/dvi; evince %s
application/ogg ; ogg123 %s
audio/x-wav ; aplay %s
audio/mpeg ; mpg321 %s
audio/*; showaudio %s
video/x-msvideo; mplayer %s
video/quicktime; mplayer %s
application/postscript; gv %s

showpicture, showaudio... is in the metamail package.

>>
>> http://www.emacswiki.org/cgi-bin/wiki/extview.el
>> --
>> A+ Thierry
>> Pub key: http://pgp.mit.edu
>>

-- 
A+ Thierry
Pub key: http://pgp.mit.edu




reply via email to

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