]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/js.el
Merge from origin/emacs-24
[gnu-emacs] / lisp / progmodes / js.el
index 27e67bb77c17575bd3ef380c4c5323d7fa7f73cc..ff002983d12d6e091c143177ea86f45715b19dbd 100644 (file)
@@ -509,13 +509,10 @@ getting timeout messages."
   :type 'integer
   :group 'js)
 
-(defcustom js-indent-first-initialiser nil
-  "Specially indent the first variable declaration's initialiser
-in variable statements.
-
-Normally, the first declaration's initialiser is unindented, and
-subsequent declarations have their identifiers lined up against
-the first:
+(defcustom js-indent-first-init nil
+  "Non-nil means specially indent the first variable declaration's initializer.
+Normally, the first declaration's initializer is unindented, and
+subsequent declarations have their identifiers aligned with it:
 
   var o = {
       foo: 3
@@ -526,8 +523,8 @@ the first:
   },
       bar = 2;
 
-When t, always indent the first declaration's initialiser by an
-additional level:
+If this option has the value t, indent the first declaration's
+initializer by an additional level:
 
   var o = {
           foo: 3
@@ -538,8 +535,8 @@ additional level:
       },
       bar = 2;
 
-When `dynamic', if there is only one declaration, don't indent
-the first one's initialiser; otherwise, indent it.
+If this option has the value `dynamic', if there is only one declaration,
+don't indent the first one's initializer; otherwise, indent it.
 
   var o = {
       foo: 3
@@ -549,7 +546,8 @@ the first one's initialiser; otherwise, indent it.
           foo: 3
       },
       bar = 2;"
-  :type 'boolean
+  :version "25.1"
+  :type '(choice (const nil) (const t) (const dynamic))
   :safe 'symbolp
   :group 'js)
 
@@ -1904,14 +1902,14 @@ In particular, return the buffer position of the first `for' kwd."
 
 (defun js--maybe-goto-declaration-keyword-end (parse-status)
   "Helper function for `js--proper-indentation'.
-Depending on the value of `js-indent-first-initialiser', move
+Depending on the value of `js-indent-first-init', move
 point to the end of a variable declaration keyword so that
 indentation is aligned to that column."
   (cond
-   ((eq js-indent-first-initialiser t)
+   ((eq js-indent-first-init t)
     (when (looking-at js--declaration-keyword-re)
       (goto-char (1+ (match-end 0)))))
-   ((eq js-indent-first-initialiser 'dynamic)
+   ((eq js-indent-first-init 'dynamic)
     (let ((bracket (nth 1 parse-status))
           declaration-keyword-end
           at-closing-bracket-p