General

EmacsWiki:Ejacs

 

 

Steve Yegge’s Javascript Mode

“An improved Java Script mode for GNU Emacs.”

 

EmacsWiki:Js2Mode

 

packaged mode

https://github.com/mooz/js2-mode
Installable from package

 

 

original mode

JS2-mode homepage (google-code)
blog announcement

 

compile issues with Emacs23

 

 

I’m useing Yegge’s mode, and it works pretty well. Sometimes chokes on syntax highlighting, and has some quirks (insists on semicolons in places where they aren’t needed; maybe I should check up on that). The indentation system is weird. I know he wrote a lot about how hard it is to do right -- but why do other modes seem to do it, then? Anyway. works.

 

 

better indentation and SVN version

http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode

 

  1. checkout the version from the SVN
  2. make it
    1. if you don’t have cygwin or linux,
    2. cd \path\to\js2-mode-read-only
    3. emacs -batch -q -l js2-build.el -f js2-build-j2-mode
    4. copy the files where they need to go
    5. (taken from Makefile
  3. follow the other directions

 

IT WORKED. finally fixed the crappy indentation.

 

 

Indentation

 

ASSUMING YOU ARE USING js2mode

 

change auto-indent level
you can do this via custom, and change it everywhere
or in .emacs -- and change it everywhere
or via (setq js2-basic-offset 2) and change it just for that local buffer
Which may be the solution for now.

 

 

 

 

my own weird codes

Javascript functions
GreaseMonkey functions

 

 

See Also

Emacs

 

Tags

JavaScript IDE Emacs greasemonkey