Description
espresso-mode is a Javascript-mode for GNU Emacs.
Espresso has been incorporated into
GNU Emacs starting with
version 23.2 and has been renamed
js-mode. espresso-mode will no
longer be maintained outside of Emacs proper. This page has been kept only
for historical interest.
Its features include:
- Good performance editing even very large files
- Support for cc-mode's smart comment wrapping and indentation
- C preprocessor support — yes, people use this with Javascript
- Full suite of movement commands, including
beginning-of-defun, end-of-defun, and
so on. This feature allows commands like
narrow-to-defun work correctly.
- Configurable recognition of class definitions. Javascript,
being a prototype-based language, has no "classes" per se, but
there are constructions that have the same conceptual meaning.
espresso-mode recognizes class definitions from several
popular Javascript frameworks, including:
- Plain Javascript (manipulating
prototype directly)
- MochiKit
- Prototype
- Dojo
- ExtJS
- Hierarchical imenu support using the aforementioned class
definition recognition with support for classes, methods,
top-level functions and nested classes.
- Robust fontification of regular expression literals
- Support for Javascript
1.6, Javascript
1.7, and Javascript
1.8 features, making espresso-mode useful for editing
Mozilla chrome.
- Mozilla integration via MozRepl.
Update Javascript running Javascript without reloading.
Also works with chrome.
Installation
Download
espresso.el and put it somewhere in your
load-path. Then add the following to your
.emacs:
(autoload #'espresso-mode "espresso" "Start espresso-mode" t)
(add-to-list 'auto-mode-alist '("\\.js$" . espresso-mode))
(add-to-list 'auto-mode-alist '("\\.json$" . espresso-mode))
For integration into Mozilla, you'll need to install MozRepl, and put moz.el
somewhere in your load-path. If you're running Emacs
22, you'll also need json.el.
Important: For best performance, espresso.el must
be byte-compiled. Use M-x byte-compile-file to
compile espresso.el.
Also, you can also always try the SVN
HEAD version of espresso.el.
History
- Version 9: 2009年07月25日
-
- Fix bug with single-character regular expressions
- Emacs 23 compatibility fixes
- Version 8: 2009年05月26日
- Fixed customization problem
- Version 7: 2009年05月22日
-
- MozRepl integration for updating running code
- Performance and robustness improvements
- Support for JS 1.7 and 1.8 syntactic constructs
- Better comment indentation
- elisp<->javascript bridge code
- Version 5: 2009年04月24日
-
- Vastly improved performance for larger files
- Direct indexing support for popular Javascript frameworks
- Configurable set of recognized frameworks
- Robust defun-movement support with an option to navigate functions as either a tree or a flat list (controlled by espresso-flat-functions
espresso-mode began as a fork of
Karl
Landstrom's javascript-mode.
Additional information and bug reports
Please see the
espresso-mode
Savannah project page for additional information and support.