]> code.delx.au - gnu-emacs-elpa/blobdiff - README.md
Handle unlimited function nesting in imenu index
[gnu-emacs-elpa] / README.md
index 04d5dd17d1861a6afc7a2e561dfdc75259bceb91..35d3ff545267be37bb467717d25ee28f5df5cc6b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -8,7 +8,9 @@ Install
 
     $ git clone git://github.com/mooz/js2-mode.git
     $ cd js2-mode
-    $ emacs --batch --eval '(byte-compile-file "js2-mode.el")'
+    $ emacs --batch -f batch-byte-compile js2-mode.el
+
+_NOTE: Emacs may fail to byte compile js2-mode.el in interactive mode (e.g., `M-x byte-compile-file`). Following the above instruction is highly recommended. See https://github.com/mooz/js2-mode/issues/13 for details._
 
 Then, place js2-mode.elc into your site-lisp directory.
 
@@ -22,10 +24,10 @@ See <http://code.google.com/p/js2-mode/wiki/InstallationInstructions> for detail
 Differences between original js2-mode.el
 ========================================
 
-Supported more popular indentation style
-----------------------------------------
+Popular indentation style
+-------------------------
 
-When js2-consistent-level-indent-inner-bracket-p is non-nil
+When `js2-consistent-level-indent-inner-bracket-p` is non-nil
     
     [foo, bar, baz].forEach(function (v) {
         if (validate(v))
@@ -36,7 +38,7 @@ When js2-consistent-level-indent-inner-bracket-p is non-nil
         return validate(v);
     });
 
-When js2-consistent-level-indent-inner-bracket-p is nil
+When `js2-consistent-level-indent-inner-bracket-p` is nil
 (Same as original js2-mode's indentation)
 
     [foo, bar, baz].forEach(function (v) {
@@ -48,8 +50,8 @@ When js2-consistent-level-indent-inner-bracket-p is nil
                        return validate(v);
                    });
 
-Fixed ugly indentation with multi-line variable declaration
------------------------------------------------------------
+Pretty multi-line variable declaration
+--------------------------------------
 
 In original js2-mode.el,
 
@@ -57,14 +59,14 @@ In original js2-mode.el,
     bar = 20,
     baz = 30;
 
-In this js2-mode.el,
+In this js2-mode.el, when the value `js2-pretty-multiline-decl-indentation-p` is non-nil,
 
     var foo = 10,
         bar = 20,
         baz = 30;
 
-Support for abbreviated destructuring assignments
--------------------------------------------------
+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)
@@ -74,8 +76,8 @@ Support for abbreviated destructuring assignments
     for (let [k, { name, age }] in Iterator(obj)) // nested
         print(k, name, age);
 
-Support for expression closure in property value
-------------------------------------------------
+Expression closure in property value
+------------------------------------
 
     let worker = {
         get age() 20,
@@ -83,8 +85,8 @@ Support for expression closure in property value
         fire: function () _fire()
     };
 
-Fixed odd indentation of "else if" with no braces
------------------------------------------------------
+Fix for odd indentation of "else if" with no braces
+---------------------------------------------------
 
 In original js2-mode.el,
 
@@ -120,28 +122,24 @@ Proper position for functions in nested object literals:
 Imenu support for function nesting
 ----------------------------------
 
-Supports one level of nesting:
-
-    function foo() {
-        function bar() { // shown as foo.bar
-            function baz() {} // hidden
-        }
-    }
-
-Top-level function can be anonymous wrapper:
+Supports function nesting and anonymous wrappers:
 
     (function() {
-        var foo = function() {}; // shown as foo
-    })();
+      var foo = function() {
+        function bar() { // shown as foo.bar.<definition-1>
+          function baz() {} // foo.bar.baz
+          var qux = function() {}; // foo.bar.quux
+        }
+      };
+    });
 
 Examples of output:
 
-* [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>
+* [jQuery 1.5](https://gist.github.com/845449)
+* [Underscore.js](https://gist.github.com/824262)
+* [Backbone.js](https://gist.github.com/824260)
 
-No support for library-specific extension methods like _.extend.
+No support for library-specific extension methods like $.extend.
 
 Highlights undeclared/external variables
 ----------------------------------------