If you edit the JavaScript files under Emacs, it is recommanded that you add the following to your .emacs: (setq auto-mode-alist (append '(("\\.js" . java-mode)) auto-mode-alist)) This will switch to Java mode, that works quite well for JavaScript files, whenever you load a .js file. Make sure all files stay in UTF-8. This is needed for internationalization and ease of maintaince.