tags:

views:

48

answers:

1

With emacs, it's pretty useful to edit HTML file. And I use 'Safari' (I'm a Mac user), to check if the HTML file is rendered correctly.

I always miss the AucTeX's forward/reverse link with pdf/tex files. I can shift-click on emacs/LaTeX file to corresponding pdf file, and vice versa. For example, when I shift-click on string 'abc' on tex source code, auc-tex finds the 'abc' string in the pdf file, and the other way round is possible.

Is there any way to do similar things in emacs? I mean, is there any tool/mode that can connect back/forth between html file and browser?

+2  A: 

Use

M-x browse-url-of-file

It's generally not bound, so I use...

(global-set-key (kbd "M-P") 'browse-url-of-file)

To globally bind Alt+Shift+p .. as "preview in browser"

slomojo
@slomojo : It opens the browser, but it doesn't seem to provide the link forward/backward.
prosseek
Ah, in that case I'm not sure what you mean by the "link forward/backward" ... how does AucTeX do it?
slomojo
@slomojo : For example, when I shift-click on string 'abc' on tex source code, auc-tex finds the 'abc' string in the pdf file, and the other way round is possible. I expect some tool that enables me to click on a string 'abc' in html to point to the corresponding web page.
prosseek
You'd need to use a specific browser and build an extension for both emacs and the browser, the facility doesn't exist at the moment.
slomojo
I'd suggest looking at how https://chrome.google.com/extensions/detail/ljobjlafonikaiipfkggjbhkghgicgoh works, this google chrome extension interfaces with emacs via a python proxy. (also see the It's All Text FireFox extension) ... both will call emacsclient, that you can start with a file line/col position.
slomojo