Table of Contents
Emacs
The hopjs.el file contains various customizations and extensions of the official Emacs js-mode.el for editing HopScript code. Its main features are:
- Mixed JavaScript/HTML automatic indentation.
- On-line documentation access.
- Parenthesis/tag matching.
- Automatic closing context.
Installation
The file hopjs.el is installed into the directory:
INSTALL_PREFIX/share/hop/site-lisp/hopjs.el
To use it, proceeds as follows:
- Add the INSTALLPREFIX/share/hop/site-lisp/hopjs.el to the Emacs
load path. For that add the
$HOME/.emacs
file the following expression:(setq load-path (cons "INSTALLPREFIX/share/hop/site-lisp" load-path))
- Add the hopjs.el file in the autoload of your emacs configuration.
Append to
$HOME/.emacs
the following expression:(autoload 'hopjs-mode-hook "hopjs" "Hop.js javascript mode hook" t)
- Hook the hopjs.el facilities to the official js-mode.el:
(add-hook 'js-mode-hook 'hopjs-mode-hook)
- Customize the js-mode indentation to conform the HopScript coding
style:
(custom-set-variables '(js-indent-level 3))
Key bindings
The hopjs.el mode defines the following key bindings:
[mouse-2]
: on highlighted identifiers jumps to the on-line documentation.[\C-c\C-c]
: closes the opening context (i.e., a opening tag or a parenthesis).
Customization
The hopjs.el configuration can be access with:
ESC-X: customize-group hopjs