From: "Simen Heggestøyl" <simenheg@gmail.com>
To: "Jostein Kjønigsen" <jostein@secure.kjonigsen.net>
Cc: jostein@kjonigsen.net, 19946@debbugs.gnu.org, dan.colascione@gmail.com
Subject: bug#19946: 24.4; js-mode, indentation
Date: Sat, 19 Mar 2016 23:13:11 +0100 [thread overview]
Message-ID: <87r3f6unew.fsf@gmail.com> (raw)
In-Reply-To: <1424858977.3139392.232164745.05CFB51D@webmail.messagingengine.com> ("Jostein \=\?utf-8\?Q\?Kj\=C3\=B8nigsen\=22's\?\= message of "Wed, 25 Feb 2015 11:09:37 +0100")
Can confirm that this bug is still present on the current master branch
(070b9de). The following patch seems to fix it:
From 9b9f09d518617d165833602d863ea8afedcec401 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= <simenheg@gmail.com>
Date: Sat, 19 Mar 2016 21:33:02 +0100
Subject: [PATCH] Handle indentation after carriage return better
* lisp/progmodes/js.el (js--proper-indentation): Handle indentation
after carriage return better (bug#19946).
---
lisp/progmodes/js.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 1e5cc60..a156080 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1963,7 +1963,7 @@ 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 (looking-at "[({[]\\s-*\\(/[/*]\\|\n\\|\r\\)")
(progn ; nothing following the opening paren/bracket
(skip-syntax-backward " ")
(when (eq (char-before) ?\)) (backward-list))
--
2.7.0
next prev parent reply other threads:[~2016-03-19 22:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-25 10:09 bug#19946: 24.4; js-mode, indentation Jostein Kjønigsen
2016-03-19 22:13 ` Simen Heggestøyl [this message]
2016-03-20 1:27 ` Dmitry Gutov
2016-03-20 8:25 ` Andreas Schwab
2016-03-20 19:01 ` Jostein Kjønigsen
2016-03-20 19:02 ` Daniel Colascione
2016-03-20 19:15 ` Jostein Kjønigsen
2016-04-03 18:05 ` John Wiegley
2016-04-03 18:17 ` Eli Zaretskii
2016-03-20 19:18 ` Dmitry Gutov
2016-03-20 19:47 ` Jostein Kjønigsen
2016-03-20 19:49 ` Dmitry Gutov
2016-03-21 0:08 ` Daniel Colascione
2016-03-21 0:32 ` Dmitry Gutov
2020-08-25 9:48 ` Lars Ingebrigtsen
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=87r3f6unew.fsf@gmail.com \
--to=simenheg@gmail.com \
--cc=19946@debbugs.gnu.org \
--cc=dan.colascione@gmail.com \
--cc=jostein@kjonigsen.net \
--cc=jostein@secure.kjonigsen.net \
/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.