]> code.delx.au - gnu-emacs-elpa/blobdiff - README.md
you -> your
[gnu-emacs-elpa] / README.md
index 4fb31d967a7a11028031ccde6be9aabfe6c7fa2b..a8f5ac8eccd4fee3371ed011b209a274315e275b 100644 (file)
--- a/README.md
+++ b/README.md
-js2-mode
-========
+Description
+======
 
 An improved JavaScript mode for GNU Emacs. Forked from <http://code.google.com/p/js2-mode/>.
 
-Install
-=======
+For some of the user-visible changes, see
+[Changes from the original mode](https://github.com/mooz/js2-mode/wiki/Changes-from-the-original-mode).
+
+Installation
+======
 
     $ git clone git://github.com/mooz/js2-mode.git
     $ cd js2-mode
-    $ emacs --batch --eval '(byte-compile-file "js2-mode.el")'
+    $ git checkout emacs24
+    $ emacs --batch -f batch-byte-compile js2-mode.el
 
-Then, place js2-mode.elc into your site-lisp directory.
+Then put js2-mode.elc into your site-lisp directory.
 
-In you emacs config:
+In your emacs config:
 
     (autoload 'js2-mode "js2-mode" nil t)
     (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
 
-See <http://code.google.com/p/js2-mode/wiki/InstallationInstructions> for details.
-
-Differences between original js2-mode.el
-========================================
-
-Supported more popular indentation style
-----------------------------------------
-
-When js2-consistent-level-indent-inner-bracket-p is non-nil
-    
-    [foo, bar, baz].forEach(function (v) {
-        if (validate(v))
-            process(v);
-    });
-    
-    [a, b, c].some(function (v) {
-        return validate(v);
-    });
-
-When js2-consistent-level-indent-inner-bracket-p is nil
-(Same as original js2-mode's indentation)
-
-    [foo, bar, baz].forEach(function (v) {
-                                if (validate(v))
-                                    process(v);
-                            });
-    
-    [a, b, c].some(function (v) {
-                       return validate(v);
-                   });
-
-Fixed ugly indentation with multi-line variable declaration
------------------------------------------------------------
-
-In original js2-mode.el,
-
-    var foo = 10,
-    bar = 20,
-    baz = 30;
-
-In this js2-mode.el,
-
-    var foo = 10,
-        bar = 20,
-        baz = 30;
-
-Support for abbreviated destructuring assignments
--------------------------------------------------
-
-    let {a, b}       = {a: 10, b: 20}; // Abbreviated   (Not supported in original js2-mode.el)
-    let {a: a, b: b} = {a: 10, b: 20}; // Same as above (Supported in original js2-mode.el)
-
-    (function ({responseText}) { /* */ })(xhr); // As the argument of function
-
-    for (let [k, { name, age }] in Iterator(obj)) // nested
-        print(k, name, age);
-
-Support for expression closure in property value
-------------------------------------------------
-
-    let worker = {
-        get age() 20,
-        get sex() "male",
-        fire: function () _fire()
-    };
+See <http://code.google.com/p/js2-mode/wiki/InstallationInstructions> for
+additional details.
 
-Fixed odd indentation of "else if" with no braces
------------------------------------------------------
+Emacs 22 and 23
+===============
 
-In original js2-mode.el,
+This version requires Emacs 24. For backwards-compatible version, check out the [`master` branch](https://github.com/mooz/js2-mode/tree/master).
 
-    if (foo)
-        return foo;
-    else if (bar)
-    return bar;      // here
-
-In this js2-mode.el,
-
-    if (foo)
-        return foo;
-    else if (bar)
-        return bar;  // fixed
-
-Fixes in Imenu support
------------------------
-
-Supports element-get form:
-
-    foo["bar"] = function() {};
-    foo[647] = function() {};
-
-Proper position for functions in nested object literals:
-
-    foo = {
-        bar: function() {}, // ok in original
-        baz: {
-             boop: function() {} // fixed here
-        },
-    }
-
-Imenu support for nested named functions
-----------------------------------------
-
-Supports one level of nesting:
-
-    function foo() {
-        function bar() { // shown as foo.bar
-            function baz() {} // hidden
-        }
-    }
-
-Top-level function can be anonymous wrapper:
-
-    (function() {
-        var foo = function() {}; // shown as foo
-    })();
-
-Examples of output:
+Bugs
+====
 
-* [Underscore.js](https://github.com/documentcloud/underscore/blob/master/underscore.js)
--> <https://gist.github.com/824262>
-* [Backbone.js](https://github.com/documentcloud/backbone/blob/master/backbone.js)
--> <https://gist.github.com/824260>
+If you find problems, please report them at <http://github.com/mooz/js2-mode/issues>.
 
-No support for library-specific extension methods, though, like _.extend.
+See Also
+======
 
-Bugs
-====
+Some third-party modes that use the generated syntax tree:
 
-If you find problems, please report them to <http://github.com/mooz/js2-mode/issues>.
+* [js2-highlight-vars-mode](http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode/js2-highlight-vars-mode)
+* [js2-refactor](https://github.com/magnars/js2-refactor.el)