From: Ingo Lohmar <i.lohmar@gmail.com>
To: James Nguyen <jamesn@fastmail.com>, 27503@debbugs.gnu.org
Cc: james@jojojames.com
Subject: bug#27503: 26.0.50; Not lining up Javascript arguments
Date: Tue, 27 Jun 2017 20:16:14 +0200 [thread overview]
Message-ID: <87fuel70up.fsf@acer.localhost.com> (raw)
In-Reply-To: <87FF3D96-DBCF-4EBD-8E72-3F796AB89FF1@fastmail.com>
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))
next prev parent reply other threads:[~2017-06-27 18:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-27 1:49 bug#27503: 26.0.50; Not lining up Javascript arguments James Nguyen
2017-06-27 18:16 ` Ingo Lohmar [this message]
2017-06-27 19:42 ` James Nguyen
2017-06-27 20:44 ` Ingo Lohmar
2017-06-28 0:45 ` James Nguyen
2017-06-28 10:36 ` Dmitry Gutov
2017-06-28 10:57 ` Nicolas Petton
2017-06-28 10:35 ` Dmitry Gutov
2017-06-28 14:56 ` Ingo Lohmar
2017-06-29 0:52 ` Dmitry Gutov
2017-07-01 11:23 ` Ingo Lohmar
2017-07-03 2:11 ` Dmitry Gutov
2017-07-03 18:05 ` Ingo Lohmar
2017-07-03 18:21 ` Ingo Lohmar
2017-07-03 21:01 ` Dmitry Gutov
2017-07-03 23:14 ` James Nguyen
2017-07-03 20:17 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fuel70up.fsf@acer.localhost.com \
--to=i.lohmar@gmail.com \
--cc=27503@debbugs.gnu.org \
--cc=james@jojojames.com \
--cc=jamesn@fastmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.