GNU bug report logs -
#27503
26.0.50; Not lining up Javascript arguments
Previous Next
Reported by: James Nguyen <jamesn <at> fastmail.com>
Date: Tue, 27 Jun 2017 05:35:01 UTC
Severity: minor
Found in version 26.0.50
Fixed in version 26.1
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 27503 <at> debbugs.gnu.org (full text, mbox):
This would effectively be the same as my snippet right? I removed the if
check and the else block to always go into the progn.
This looks good to me unless there are other gotchas. Making it
configurable is ideal.
--
James Nguyen
jamesn <at> fastmail.com
On Tue, Jun 27, 2017, at 11:16 AM, Ingo Lohmar wrote:
> I've been meaning to post this for months, guess now is as good a time
> as any. Here's an alternative take that I've been using for a long time
> without noticing any bugs. It is a less intrusive change to achieve the
> desired effect AFAICT:
>
>
>
> diff --git i/lisp/progmodes/js.el w/lisp/progmodes/js.el
> index bae9e52bf0..a27db82eb0 100644
> --- i/lisp/progmodes/js.el
> +++ w/lisp/progmodes/js.el
> @@ -475,6 +475,11 @@ js-flat-functions
> :type 'boolean
> :group 'js)
>
> +(defcustom js-cont-nonempty-list-indent-rigidly nil
> + "Indent continuation of non-empty ([{ lines in `js-mode' rigidly."
> + :type 'boolean
> + :group 'js)
> +
> (defcustom js-comment-lineup-func #'c-lineup-C-comments
> "Lineup function for `cc-mode-style', for C comments in `js-mode'."
> :type 'function
> @@ -2092,7 +2097,8 @@ js--proper-indentation
> (switch-keyword-p (looking-at
> "default\\_>\\|case\\_>[^:]"))
> (continued-expr-p (js--continued-expression-p)))
> (goto-char (nth 1 parse-status)) ; go to the opening char
> - (if (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)")
> + (if (or js-cont-nonempty-list-indent-rigidly
> + (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)"))
> (progn ; nothing following the opening paren/bracket
> (skip-syntax-backward " ")
> (when (eq (char-before) ?\)) (backward-list))
This bug report was last modified 7 years and 328 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.