I just played with Stevey’s new js2-mode. So many previous javascript modes for emacs just didn’t cut it, but now finally, I’m proud to see a javascript mode that works. Steve did a great job with this package. Kudos.
Installation
Grab the latest js2, put it in your load-path, and configure. Full instructions. Here’s my config:
(autoload 'js2-mode "js2" nil t) (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) (setq js2-basic-offset 2) (setq js2-use-font-lock-faces t) |
(Steve, I’m one of those who like my font-lock settings, so thanks for keeping the font-lock-faces option around for us crazies.)
Features
- Indenting that works! Finally.
- Syntax highlighting that works. ‘Bout time.
- Inline warnings and syntax errors. Useful.

- Decent code folding. I like.

- Other tidbits. You’ll have to read Steve’s long-winded post for more.
9 responses so far ↓
What font do you use?
Soltys, I use Monaco 12 on OS X:
Speaking of which, have you used http://emacs-app.sourceforge.net/ before? It seems like a much better mac citizen than carbon emacs.
This new mode is great. I found a few subtle syntax problems as soon as I started using it.
Josh, Yes, I’ve tried Emacs.app. I didn’t much care for it. Emacs is the one application I don’t want to behave like a Mac citizen, yet I found Emacs.app to be both a poor Mac citizen and a poor Emacs citizen. It’s been a long while, and you peeked my interest so I tried Emacs.app again. Unfortunately, I found the out-of-box experience to be as poor as I remember. I’m afraid I’ll have to stick with Carbon Emacs. What about Emacs.app do you particular like? As far as Mac citizenship goes, Aquamacs is probably the winner in my eyes.
Ted, Please be sure to submit those syntax problems to Steve.
What color theme are you using? =)
Will, color-theme-arjen:
Hey man, glad you like the mode!
I’ve only made minor bug fixes and tweaks for the past month or so, but today I started on a major overhaul, prompted by a growing bug backlog and also getting some mileage using the mode myself. I’ve been working with the mumamo.el guy to figure out a way to make them work together, and I think we’ve got a solution. Hopefully I can post a big update in the next few weeks.
FWIW, the FSF has offered to bundle it with the next version of Emacs. I’ve signed the paperwork and assigned them the copyright, etc. Neat.
I also use Carbon Emacs and Monaco 12 point (antialiased, of course). Love it!
Cheers,
-steve
What picture remark tool are you using? _
Leave a Comment