Every repository with this icon (
Every repository with this icon (
Emacs integration
Download javascript.el and
moz.el and place them somewhere in Emacs’ load-path. Alternatively, place them in any directory (e.g. “/home/user/emacsfiles”) then add that directory to the load-path, as follows:
Update: We’re now including also espresso.el, an improved version of javascript.el. See below for instructions. Barring problems, espresso.el will replace javascript.el in the near future.
(add-to-list 'load-path "/home/user/emacsfiles")
moz.el contains a major mode for direct interaction in a buffer (as with telnet) and a minor mode for sending code portions or whole files from other buffers.
Add this to your .emacs file:
(autoload 'moz-minor-mode "moz" "Mozilla Minor and Inferior Mozilla Modes" t)
(add-hook 'javascript-mode-hook 'javascript-custom-setup)
(defun javascript-custom-setup ()
(moz-minor-mode 1))
Or if you’re trying espresso.el, add this:
(autoload 'moz-minor-mode "moz" "Mozilla Minor and Inferior Mozilla Modes" t)
(add-hook 'espresso-mode-hook 'espresso-custom-setup)
(defun espresso-custom-setup ()
(moz-minor-mode 1))
Restart Emacs, and every time you open a Javascript file, you will now
have the following keybindings available:
C-c C-s: open a MozRepl interaction buffer and switch to itC-c C-l: save the current buffer and load it in MozReplC-M-x: send the current function (as recognized byc-mark-function) to MozReplC-c C-c: send the current function to MozRepl and switch to the interaction bufferC-c C-r: send the current region to MozRepl
In the interaction buffer:
C-c c: insert the current name of the REPL plus the dot operator (usuallyrepl.)
Tips & tricks
The predictive abbreviation mode
is very handy when working in Javascript source buffers.






