branch: elpa/slime commit 04d9f9ebe39e0d682f17a8d696a85478b4d18b72 Author: Stas Boukarev <stass...@gmail.com> Commit: Stas Boukarev <stass...@gmail.com>
slime-parse-form-until: don't allow bad sexps to jump outside. Which might enter an endless loop. --- contrib/slime-parse.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/contrib/slime-parse.el b/contrib/slime-parse.el index cd5451c529d..825d334a136 100644 --- a/contrib/slime-parse.el +++ b/contrib/slime-parse.el @@ -46,9 +46,14 @@ (t (let ((pt1 (point)) (pt2 (condition-case e - (progn (forward-sexp) (point)) - (scan-error - (cl-fourth e))))) ; end of sexp + (progn (forward-sexp) (point)) + (scan-error + (let ((error-end (nth 3 e))) + (if (and todo + (>= error-end (car todo))) + ;; The error jumped out of the outer sexp + (1- (car todo)) + error-end)))))) (push (buffer-substring-no-properties pt1 pt2) cursexp) (push pt2 todo) (push cursexp sexps)))))