[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to run javascript in emacs?
From: |
Arnaud Diederen (aundro) |
Subject: |
Re: how to run javascript in emacs? |
Date: |
Wed, 16 Jul 2008 12:04:55 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
Xah,
in-, and out-ing to a SpiderMonkey is a first step, but is widely
insufficient.
I'm doing a rather important part of my work in JavaScript, and
the problem with SpiderMonkey is that, although it proposes the (solid)
implementation of ECMAScript ed. 3 that is embedded in
Mozilla and FireFox, it will _not_ make the host objects (window,
document, ...) available.
In other words, you'll be able to execute core JavaScript code, but not
DHTML, not interact with a browser HTML DOM tree, which is often
necessary.
An alternative to mozlab is Helmut Eller's Emacs JavaScript shell:
http://the.unwashedmeme.com/blog/2005/06/02/javascript-shellserver-for-emacs/
It's not perfect in every possible way, but might still be helpful.
(I've never used mozlab, so I don't know if it's better than the emacs
js shell)
Now, to follow on Tim's advise about the javascript mode, I must say
it's a rather trivial mode; barely more than a patched c-mode.
I suggest you have a look at Steve Yegge's js2-mode:
http://steve-yegge.blogspot.com/2008/03/js2-mode-new-javascript-mode-for-emacs.html
Hope that helps,
Arnaud