* lisp/emacs-lisp/lisp-mode.el (lisp-ppss): Fix performance bug
(nth 2 ppss) can be absent but not incorrect, so don't recompute ppss for (nth 2 ppss) when (nth 2 ppss) is already provided. When calling `lisp-indent-line` on all the lines in a region, this sometimes introduced a gratuitous O(N²) complexity.
This commit is contained in:
parent
fef27d28fa
commit
f411cc3a95
1 changed files with 1 additions and 1 deletions
|
@ -876,7 +876,7 @@ complete sexp in the innermost containing list at position
|
|||
2 (counting from 0). This is important for Lisp indentation."
|
||||
(unless pos (setq pos (point)))
|
||||
(let ((pss (syntax-ppss pos)))
|
||||
(if (nth 9 pss)
|
||||
(if (and (not (nth 2 pss)) (nth 9 pss))
|
||||
(let ((sexp-start (car (last (nth 9 pss)))))
|
||||
(parse-partial-sexp sexp-start pos nil nil (syntax-ppss sexp-start)))
|
||||
pss)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue