* bug#25215: 25.1.90; js--proper-indentation is affected by the value of forward-sexp-function
@ 2016-12-16 12:58 Dmitry Gutov
2016-12-16 21:02 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Gutov @ 2016-12-16 12:58 UTC (permalink / raw)
To: 25215
js2-mode derives from js-mode and, starting with Emacs 25.1, inherits
its indentation function.
However, forward-sexp-function in js2-mode can be slow because it uses
the AST, and when the current parsing pass had been interrupted by user
input, it's forced to finish. Which is slow in large files.
And its subtleties aren't really needed by the intentation code. So in
the various bits of code we've brought over from js2-mode we have kept
the forward-sexp-function->nil binding.
We've missed it in js--multi-line-declaration-indentation, hovewer. And
in js--maybe-goto-declaration-keyword-end (though that one only comes
into play with a non-default value of js-indent-first-init).
The patch is below.
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 6d995a0..9aa459d 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1851,7 +1851,8 @@ js--multi-line-declaration-indentation
"Helper function for `js--proper-indentation'.
Return the proper indentation of the current line if it belongs to a
declaration
statement spanning multiple lines; otherwise, return nil."
- (let (at-opening-bracket)
+ (let (forward-sexp-function ; Use Lisp version.
+ at-opening-bracket)
(save-excursion
(back-to-indentation)
(when (not (looking-at js--declaration-keyword-re))
@@ -1928,6 +1929,7 @@ js--maybe-goto-declaration-keyword-end
(let ((bracket (nth 1 parse-status))
declaration-keyword-end
at-closing-bracket-p
+ forward-sexp-function ; Use Lisp version.
comma-p)
(when (looking-at js--declaration-keyword-re)
(setq declaration-keyword-end (match-end 0))
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#25215: 25.1.90; js--proper-indentation is affected by the value of forward-sexp-function
2016-12-16 12:58 bug#25215: 25.1.90; js--proper-indentation is affected by the value of forward-sexp-function Dmitry Gutov
@ 2016-12-16 21:02 ` Eli Zaretskii
2016-12-17 0:00 ` Dmitry Gutov
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2016-12-16 21:02 UTC (permalink / raw)
To: Dmitry Gutov; +Cc: 25215
> From: Dmitry Gutov <dgutov@webzilla.com>
> Date: Fri, 16 Dec 2016 14:58:35 +0200
>
> js2-mode derives from js-mode and, starting with Emacs 25.1, inherits
> its indentation function.
>
> However, forward-sexp-function in js2-mode can be slow because it uses
> the AST, and when the current parsing pass had been interrupted by user
> input, it's forced to finish. Which is slow in large files.
>
> And its subtleties aren't really needed by the intentation code. So in
> the various bits of code we've brought over from js2-mode we have kept
> the forward-sexp-function->nil binding.
>
> We've missed it in js--multi-line-declaration-indentation, hovewer. And
> in js--maybe-goto-declaration-keyword-end (though that one only comes
> into play with a non-default value of js-indent-first-init).
>
> The patch is below.
Thanks, this is okay for the release branch.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-17 0:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-16 12:58 bug#25215: 25.1.90; js--proper-indentation is affected by the value of forward-sexp-function Dmitry Gutov
2016-12-16 21:02 ` Eli Zaretskii
2016-12-17 0:00 ` Dmitry Gutov
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.