Commit 59fd76c1 authored by Stefan Monnier's avatar Stefan Monnier

* lisp/emacs-lisp/lisp-mode.el (lisp--el-non-funcall-position-p):

Avoid pathological slowdown at top-level in large file.
parent 17a8618d
......@@ -181,22 +181,23 @@
(defun lisp--el-non-funcall-position-p (&optional pos)
(defun lisp--el-non-funcall-position-p (pos)
"Heuristically determine whether POS is an evaluated position."
(setf pos (or pos (point)))
(goto-char pos)
(or (eql (char-before) ?\')
(let ((parent
(up-list -1)
(let* ((ppss (syntax-ppss))
(paren-posns (nth 9 ppss))
(when paren-posns
(goto-char (car (last paren-posns))) ;(up-list -1)
(and (eql (char-after) ?\()
(up-list -1)
(when (cdr paren-posns)
(goto-char (car (last paren-posns 2)))
(looking-at "(\\_<let\\*?\\_>"))))
(goto-char (match-end 0))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment