Commit ca9fb109 authored by akater's avatar akater Committed by Lars Ingebrigtsen
Browse files

lisp/emacs-lisp/lisp-mode.el: Fix parser state corruption.

* lisp/emacs-lisp/lisp-mode.el (lisp--local-defform-body-p): Preserve
the point.
* test/lisp/progmodes/elisp-mode-resources/flet.erts: Add corresponding
test example (bug#9622).
parent 51aa6cee
Pipeline #13733 passed with stages
in 132 minutes and 36 seconds
......@@ -1148,12 +1148,13 @@ STATE is the `parse-partial-sexp' state for current position."
;; that starts a sexp.
t)
(point))))))
(ignore-errors
;; We rely on `backward-up-list' working
;; even when sexp is incomplete “to the right”.
(backward-up-list 2)
t)
(= local-definitions-starting-point (point))))))))
(save-excursion
(ignore-errors
;; We rely on `backward-up-list' working
;; even when sexp is incomplete “to the right”.
(backward-up-list 2)
t)
(= local-definitions-starting-point (point)))))))))
(defun lisp-indent-function (indent-point state)
"This function is the normal value of the variable `lisp-indent-function'.
......
......@@ -221,6 +221,16 @@ Name: flet15
i)))
=-=-=
Name: flet16
=-=
(cl-flet ((f (x)
(g x)))
(pcase e
((dangerous-expression)
(form))))
=-=-=
Name: flet-indentation-incomplete-sexp-no-side-effects-1
Code: (lambda () (emacs-lisp-mode) (setq indent-tabs-mode nil) (newline nil t))
Point-Char: |
......
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