commit f0e8673a9e708fc0ba6c092ec2fc777efbb4bb23 (HEAD, refs/remotes/origin/master) Author: Jackson Ray Hamilton Date: Tue Mar 10 22:07:10 2015 -0700 * indent/js-indent-init-dynamic.js: Fix spelling error. diff --git a/test/ChangeLog b/test/ChangeLog index fba6cfc..6a474e1 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2015-03-10 Jackson Ray Hamilton + + * indent/js-indent-init-dynamic.js: Fix spelling error. + 2015-03-10 Paul Eggert Prefer "initialize" to "initialise" diff --git a/test/indent/js-indent-init-dynamic.js b/test/indent/js-indent-init-dynamic.js index f330c2c..536a976 100644 --- a/test/indent/js-indent-init-dynamic.js +++ b/test/indent/js-indent-init-dynamic.js @@ -17,7 +17,7 @@ var foo = function() { // Local Variables: // indent-tabs-mode: nil // js-indent-level: 2 -// js-indent-first-initializer: dynamic +// js-indent-first-init: dynamic // End: // The following test intentionally produces a scan error and should commit 2a1be9eb2361f705e61839b78e8bba1d841944f6 Author: Paul Eggert Date: Tue Mar 10 16:29:01 2015 -0700 Prefer "initialize" to "initialise" * lisp/progmodes/js.el (js-indent-first-init): Rename from js-indent-first-initialiser, to avoid worrying about American vs British spelling. All uses changed. * test/indent/js-indent-init-t.js: Rename from indent/js-indent-first-initialiser-t.js. * test/indent/js-indent-init-dynamic.js: Rename from test/indent/js-indent-first-initialiser-dynamic.js. diff --git a/ChangeLog b/ChangeLog index 5e5c922..4f6523e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -394,7 +394,7 @@ 2014-11-25 Glenn Morris - * configure.ac: Fix yesterday's use of uninitialised $version. + * configure.ac: Fix yesterday's use of uninitialized $version. 2014-11-25 Oscar Fuentes diff --git a/etc/NEWS b/etc/NEWS index 6f59064..75d55de 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -389,7 +389,7 @@ The remainder were: ** New ERT function `ert-summarize-tests-batch-and-exit'. -** New js.el option `js-indent-first-initialiser'. +** New js.el option `js-indent-first-init'. --- ** `Info-fontify-maximum-menu-size' can be t for no limit. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b798e14..b25988d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2015-03-10 Paul Eggert + + Prefer "initialize" to "initialise" + * progmodes/js.el (js-indent-first-init): + Rename from js-indent-first-initialiser, to avoid worrying about + American vs British spelling. All uses changed. + 2015-03-10 Glenn Morris * progmodes/js.el (js-indent-first-initialiser): @@ -4551,7 +4558,7 @@ (tildify-foreach-region-function): New variable specifying a function determining portions of buffer that should be tildified. It allows major modes to create a filtering function - more elaborate than a set of regular expressions. Initialised to + more elaborate than a set of regular expressions. Initialized to `tildify--deprecated-ignore-evironments' by default to handle now deprecated `tildify-ignored-environments-alist' variable. (tildify--foreach-region): A new function that takes @@ -9015,7 +9022,7 @@ file-format 2 --- ie. no local printers --- and 3 --- i.e. may have local printers. (ses-localvars): Add local variables needed for local printer handling. - (ses-set-localvars): Handle hashmap initialisation. + (ses-set-localvars): Handle hashmap initialization. (ses-paramlines-plist): Add param-line for number of local printers. (ses-paramfmt-plist): New defconst, needed for code factorization between functions `ses-set-parameter' and @@ -12275,7 +12282,7 @@ * progmodes/cc-mode.el (c-initialize-cc-mode): Add CC Mode hooks to electric-indent-{,local-}-mode. (c-basic-common-init): Set electric-indent-inhibit. - Initialise c-electric-flag from electric-indent-mode. + Initialize c-electric-flag from electric-indent-mode. (c-electric-indent-mode-hook, c-electric-indent-local-mode-hook): New hook functions which propagate electric-indent-mode to CC mode. @@ -24212,7 +24219,7 @@ 2013-04-30 Alan Mackenzie - Handle arbitrarily long C++ member initialisation lists. + Handle arbitrarily long C++ member initialization lists. * progmodes/cc-engine.el (c-back-over-member-initializers): new function. (c-guess-basic-syntax): New CASE 5R (extracted from 5B) to handle diff --git a/lisp/ChangeLog.16 b/lisp/ChangeLog.16 index 14ee914..bf8a973 100644 --- a/lisp/ChangeLog.16 +++ b/lisp/ChangeLog.16 @@ -6751,7 +6751,7 @@ 2012-09-09 Alan Mackenzie * progmodes/cc-engine.el (c-state-cache-init): - Initialise c-state-semi-nonlit-pos-cache\(-limit\)? properly. + Initialize c-state-semi-nonlit-pos-cache\(-limit\)? properly. (c-record-parse-state-state): Record c-state-semi-nonlit-pos-cache\(-limit\)?. @@ -15662,7 +15662,7 @@ (c-nonlabel-token-key): Allow string literals for AWK. Refactor for the other modes. - Large brace-block initialisation makes CC Mode slow: Fix. + Large brace-block initialization makes CC Mode slow: Fix. Tidy up and accelerate c-in-literal, etc. by using the c-parse-state routines. Limit backward searching in c-font-lock-enclosing.decl. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 7e54742..ff00298 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -509,9 +509,9 @@ getting timeout messages." :type 'integer :group 'js) -(defcustom js-indent-first-initialiser nil - "Non-nil means specially indent the first variable declaration's initialiser. -Normally, the first declaration's initialiser is unindented, and +(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 = { @@ -524,7 +524,7 @@ subsequent declarations have their identifiers aligned with it: bar = 2; If this option has the value t, indent the first declaration's -initialiser by an additional level: +initializer by an additional level: var o = { foo: 3 @@ -536,7 +536,7 @@ initialiser by an additional level: bar = 2; If this option has the value `dynamic', if there is only one declaration, -don't indent the first one's initialiser; otherwise, indent it. +don't indent the first one's initializer; otherwise, indent it. var o = { foo: 3 @@ -1902,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 diff --git a/test/ChangeLog b/test/ChangeLog index 93ee3c5..fba6cfc 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,11 @@ +2015-03-10 Paul Eggert + + Prefer "initialize" to "initialise" + * indent/js-indent-init-t.js: Rename from + indent/js-indent-first-initialiser-t.js. + * indent/js-indent-init-dynamic.js: Rename from + test/indent/js-indent-first-initialiser-dynamic.js. + 2015-03-10 Jackson Ray Hamilton * indent/js.js: Add local variables. diff --git a/test/indent/js-indent-first-initialiser-dynamic.js b/test/indent/js-indent-first-initialiser-dynamic.js deleted file mode 100644 index 9c705db..0000000 --- a/test/indent/js-indent-first-initialiser-dynamic.js +++ /dev/null @@ -1,30 +0,0 @@ -var foo = function() { - return 7; -}; - -var foo = function() { - return 7; - }, - bar = 8; - -var foo = function() { - return 7; - }, - bar = function() { - return 8; - }; - -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 2 -// js-indent-first-initialiser: dynamic -// End: - -// The following test intentionally produces a scan error and should -// be placed below all other tests to prevent awkward indentation. -// (It still thinks it's within the body of a function.) - -var foo = function() { - return 7; - , - bar = 8; diff --git a/test/indent/js-indent-first-initialiser-t.js b/test/indent/js-indent-first-initialiser-t.js deleted file mode 100644 index 2f08527..0000000 --- a/test/indent/js-indent-first-initialiser-t.js +++ /dev/null @@ -1,21 +0,0 @@ -var foo = function() { - return 7; - }; - -var foo = function() { - return 7; - }, - bar = 8; - -var foo = function() { - return 7; - }, - bar = function() { - return 8; - }; - -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 2 -// js-indent-first-initialiser: t -// End: diff --git a/test/indent/js-indent-init-dynamic.js b/test/indent/js-indent-init-dynamic.js new file mode 100644 index 0000000..f330c2c --- /dev/null +++ b/test/indent/js-indent-init-dynamic.js @@ -0,0 +1,30 @@ +var foo = function() { + return 7; +}; + +var foo = function() { + return 7; + }, + bar = 8; + +var foo = function() { + return 7; + }, + bar = function() { + return 8; + }; + +// Local Variables: +// indent-tabs-mode: nil +// js-indent-level: 2 +// js-indent-first-initializer: dynamic +// End: + +// The following test intentionally produces a scan error and should +// be placed below all other tests to prevent awkward indentation. +// (It still thinks it's within the body of a function.) + +var foo = function() { + return 7; + , + bar = 8; diff --git a/test/indent/js-indent-init-t.js b/test/indent/js-indent-init-t.js new file mode 100644 index 0000000..bb75542 --- /dev/null +++ b/test/indent/js-indent-init-t.js @@ -0,0 +1,21 @@ +var foo = function() { + return 7; + }; + +var foo = function() { + return 7; + }, + bar = 8; + +var foo = function() { + return 7; + }, + bar = function() { + return 8; + }; + +// Local Variables: +// indent-tabs-mode: nil +// js-indent-level: 2 +// js-indent-first-init: t +// End: commit c3ca6a911a84e49aa0a0126cfc8640b90fb73572 Author: Glenn Morris Date: Tue Mar 10 18:46:39 2015 -0400 # Further ChangeLog fix diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5184167..b798e14 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -7,6 +7,7 @@ * progmodes/js.el (js-indent-first-initialiser): New option. (js--maybe-goto-declaration-keyword-end): New function. + (js--proper-indentation): Use js--maybe-goto-declaration-keyword-end. 2015-03-10 Thomas Fitzsimmons commit 6c9681afe9d7296bc984f602a26cf78d577fcc1e Author: Glenn Morris Date: Tue Mar 10 18:40:09 2015 -0400 * lisp/progmodes/js.el (js-indent-first-initialiser): Fix doc, type, version. First line of the doc string should be a complete sentence. * etc/NEWS: Mention new option. # Fix associated ChangeLog entries. diff --git a/etc/NEWS b/etc/NEWS index ad8b6f2..6f59064 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -389,6 +389,8 @@ The remainder were: ** New ERT function `ert-summarize-tests-batch-and-exit'. +** New js.el option `js-indent-first-initialiser'. + --- ** `Info-fontify-maximum-menu-size' can be t for no limit. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c7cf53d..5184167 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,16 +1,12 @@ -2015-03-10 Jackson Ray Hamilton - - * lisp/progmodes/js.el (js--proper-indentation): Add new custom - option `js-indent-first-initialiser' and a function to utilize it, - `js--maybe-goto-declaration-keyword-end'. +2015-03-10 Glenn Morris - * test/indent/js.js: Add local variables. + * progmodes/js.el (js-indent-first-initialiser): + Fix doc, type, version. - * test/indent/js-indent-first-initialiser-t.js: New test for - `js-indent-first-initialiser'. +2015-03-10 Jackson Ray Hamilton - * test/indent/js-indent-first-initialiser-dynamic.js: New test for - `js-indent-first-initialiser'. + * progmodes/js.el (js-indent-first-initialiser): New option. + (js--maybe-goto-declaration-keyword-end): New function. 2015-03-10 Thomas Fitzsimmons diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 27e67bb..7e54742 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -510,12 +510,9 @@ getting timeout messages." :group 'js) (defcustom js-indent-first-initialiser nil - "Specially indent the first variable declaration's initialiser -in variable statements. - + "Non-nil means specially indent the first variable declaration's initialiser. Normally, the first declaration's initialiser is unindented, and -subsequent declarations have their identifiers lined up against -the first: +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 +initialiser 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 initialiser; 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) diff --git a/test/ChangeLog b/test/ChangeLog index 03cc281..93ee3c5 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,11 @@ +2015-03-10 Jackson Ray Hamilton + + * indent/js.js: Add local variables. + + * indent/js-indent-first-initialiser-t.js: + * indent/js-indent-first-initialiser-dynamic.js: + New tests for `js-indent-first-initialiser'. + 2015-03-10 Przemyslaw Wojnowski * automated/cl-lib-tests.el: Add tests for plusp, second, ... commit 8db37916ca4241ee977901ae589a86a609a32c3c Author: Glenn Morris Date: Tue Mar 10 18:37:35 2015 -0400 * lisp/gnus/message.el (message-valid-fqdn-regexp): Bump :version diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 763267c..1744a13 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2015-03-10 Glenn Morris + + * message.el (message-valid-fqdn-regexp): Bump :version for + 2014-11-17 change. + 2015-03-08 Rasmus Pank Roulund * gnus-notifications.el (gnus-notifications-action): Raise window diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 112f0ba..04145de 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -1969,7 +1969,7 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'." ;; "dead" nato bitnet uucp "Regular expression that matches a valid FQDN." ;; see also: gnus-button-valid-fqdn-regexp - :version "22.1" + :version "25.1" :group 'message-headers :type 'regexp) commit 933e0ab4b0d583b81b8624def414b7895987927b Author: Jackson Ray Hamilton Date: Sat Mar 7 18:01:05 2015 -0800 New indentation option for js-mode * lisp/progmodes/js.el (js--proper-indentation): Add new custom option `js-indent-first-initialiser' and a function to utilize it, `js--maybe-goto-declaration-keyword-end'. * test/indent/js.js: Add local variables. * test/indent/js-indent-first-initialiser-t.js: New test for `js-indent-first-initialiser'. * test/indent/js-indent-first-initialiser-dynamic.js: New test for `js-indent-first-initialiser'. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c25f4ef..c7cf53d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2015-03-10 Jackson Ray Hamilton + + * lisp/progmodes/js.el (js--proper-indentation): Add new custom + option `js-indent-first-initialiser' and a function to utilize it, + `js--maybe-goto-declaration-keyword-end'. + + * test/indent/js.js: Add local variables. + + * test/indent/js-indent-first-initialiser-t.js: New test for + `js-indent-first-initialiser'. + + * test/indent/js-indent-first-initialiser-dynamic.js: New test for + `js-indent-first-initialiser'. + 2015-03-10 Thomas Fitzsimmons * net/ldap.el (ldap-attribute-syntaxes-alist): Add LDAP attributes diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index d7712e4..27e67bb 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -509,6 +509,50 @@ 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: + + var o = { + foo: 3 + }; + + var o = { + foo: 3 + }, + bar = 2; + +When t, always indent the first declaration's initialiser by an +additional level: + + var o = { + foo: 3 + }; + + var o = { + foo: 3 + }, + bar = 2; + +When `dynamic', if there is only one declaration, don't indent +the first one's initialiser; otherwise, indent it. + + var o = { + foo: 3 + }; + + var o = { + foo: 3 + }, + bar = 2;" + :type 'boolean + :safe 'symbolp + :group 'js) + ;;; KeyMap (defvar js-mode-map @@ -1858,6 +1902,36 @@ In particular, return the buffer position of the first `for' kwd." (goto-char for-kwd) (current-column)))) +(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 +point to the end of a variable declaration keyword so that +indentation is aligned to that column." + (cond + ((eq js-indent-first-initialiser t) + (when (looking-at js--declaration-keyword-re) + (goto-char (1+ (match-end 0))))) + ((eq js-indent-first-initialiser 'dynamic) + (let ((bracket (nth 1 parse-status)) + declaration-keyword-end + at-closing-bracket-p + comma-p) + (when (looking-at js--declaration-keyword-re) + (setq declaration-keyword-end (match-end 0)) + (save-excursion + (goto-char bracket) + (setq at-closing-bracket-p + (condition-case nil + (progn + (forward-sexp) + t) + (error nil))) + (when at-closing-bracket-p + (while (forward-comment 1)) + (setq comma-p (looking-at-p ",")))) + (when comma-p + (goto-char (1+ declaration-keyword-end)))))))) + (defun js--proper-indentation (parse-status) "Return the proper indentation for the current line." (save-excursion @@ -1891,6 +1965,7 @@ In particular, return the buffer position of the first `for' kwd." (skip-syntax-backward " ") (when (eq (char-before) ?\)) (backward-list)) (back-to-indentation) + (js--maybe-goto-declaration-keyword-end parse-status) (let* ((in-switch-p (unless same-indent-p (looking-at "\\_"))) (same-indent-p (or same-indent-p diff --git a/test/indent/js-indent-first-initialiser-dynamic.js b/test/indent/js-indent-first-initialiser-dynamic.js new file mode 100644 index 0000000..9c705db --- /dev/null +++ b/test/indent/js-indent-first-initialiser-dynamic.js @@ -0,0 +1,30 @@ +var foo = function() { + return 7; +}; + +var foo = function() { + return 7; + }, + bar = 8; + +var foo = function() { + return 7; + }, + bar = function() { + return 8; + }; + +// Local Variables: +// indent-tabs-mode: nil +// js-indent-level: 2 +// js-indent-first-initialiser: dynamic +// End: + +// The following test intentionally produces a scan error and should +// be placed below all other tests to prevent awkward indentation. +// (It still thinks it's within the body of a function.) + +var foo = function() { + return 7; + , + bar = 8; diff --git a/test/indent/js-indent-first-initialiser-t.js b/test/indent/js-indent-first-initialiser-t.js new file mode 100644 index 0000000..2f08527 --- /dev/null +++ b/test/indent/js-indent-first-initialiser-t.js @@ -0,0 +1,21 @@ +var foo = function() { + return 7; + }; + +var foo = function() { + return 7; + }, + bar = 8; + +var foo = function() { + return 7; + }, + bar = function() { + return 8; + }; + +// Local Variables: +// indent-tabs-mode: nil +// js-indent-level: 2 +// js-indent-first-initialiser: t +// End: diff --git a/test/indent/js.js b/test/indent/js.js index f41849d..ad7cb56 100644 --- a/test/indent/js.js +++ b/test/indent/js.js @@ -1,5 +1,3 @@ -// -*- js-indent-level: 2 -*- - var a = 1; b = 2; @@ -65,3 +63,8 @@ b += baz(`http://foo.bar/${tee}`) .qux(); + +// Local Variables: +// indent-tabs-mode: nil +// js-indent-level: 2 +// End: