Commit 92de44fa authored by Noam Postavsky's avatar Noam Postavsky

Don't error when indenting malformed Lisp (Bug#30891)

* lisp/emacs-lisp/lisp-mode.el (lisp-indent-calc-next): If we run out
of indent stack, reset the parse state.
parent c3adbc88
......@@ -827,6 +827,10 @@ by more than one line to cross a string literal."
(prog1
(let (indent)
(cond ((= (forward-line 1) 1) nil)
;; Negative depth, probably some kind of syntax error.
((null indent-stack)
;; Reset state.
(setq ppss (parse-partial-sexp (point) (point))))
((car indent-stack))
((integerp (setq indent (calculate-lisp-indent ppss)))
(setf (car indent-stack) indent))
......
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