GNU bug report logs - #25215
25.1.90; js--proper-indentation is affected by the value of forward-sexp-function

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Fri, 16 Dec 2016 16:38:02 UTC

Severity: normal

Found in version 25.1.90

Done: Dmitry Gutov <dgutov <at> webzilla.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Dmitry Gutov <dgutov <at> webzilla.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#25215: closed (25.1.90; js--proper-indentation is affected by
 the value of forward-sexp-function)
Date: Sat, 17 Dec 2016 00:01:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 17 Dec 2016 02:00:27 +0200
with message-id <58433690-7fe4-662b-cce4-1a44cd4c416f <at> webzilla.com>
and subject line Re: bug#25215: 25.1.90; js--proper-indentation is affected by the value of forward-sexp-function
has caused the debbugs.gnu.org bug report #25215,
regarding 25.1.90; js--proper-indentation is affected by the value of forward-sexp-function
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
25215: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25215
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Dmitry Gutov <dgutov <at> webzilla.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.90; js--proper-indentation is affected by the value of
 forward-sexp-function
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.

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))


[Message part 3 (message/rfc822, inline)]
From: Dmitry Gutov <dgutov <at> webzilla.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25215-done <at> debbugs.gnu.org
Subject: Re: bug#25215: 25.1.90; js--proper-indentation is affected by the
 value of forward-sexp-function
Date: Sat, 17 Dec 2016 02:00:27 +0200
On 16.12.2016 23:02, Eli Zaretskii wrote:

> Thanks, this is okay for the release branch.

Thanks, installed.


This bug report was last modified 8 years and 217 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.