all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@webzilla.com>
To: 25215@debbugs.gnu.org
Subject: bug#25215: 25.1.90; js--proper-indentation is affected by the value of forward-sexp-function
Date: Fri, 16 Dec 2016 14:58:35 +0200	[thread overview]
Message-ID: <d1f972e9-d04c-dfce-7893-0f755b915071@webzilla.com> (raw)

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





             reply	other threads:[~2016-12-16 12:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-16 12:58 Dmitry Gutov [this message]
2016-12-16 21:02 ` bug#25215: 25.1.90; js--proper-indentation is affected by the value of forward-sexp-function Eli Zaretskii
2016-12-17  0:00   ` 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=d1f972e9-d04c-dfce-7893-0f755b915071@webzilla.com \
    --to=dgutov@webzilla.com \
    --cc=25215@debbugs.gnu.org \
    /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.