Avoid potential infloop

* lisp/progmodes/python.el
(python-info-dedenter-opening-block-positions):
Avoid potential infloop (bug#62031).
This commit is contained in:
Dmitry Gutov 2023-03-09 00:43:31 +02:00
parent 34c14430e9
commit c2ca009da4

View file

@ -5792,9 +5792,9 @@ likely an invalid python file."
(catch 'exit (catch 'exit
(while (python-nav--syntactically (while (python-nav--syntactically
(lambda () (lambda ()
(cl-loop for pt = (re-search-backward (python-rx block-start) nil t) (cl-loop while (re-search-backward (python-rx block-start) nil t)
until (memq (char-before) '(nil ?\s ?\t ?\n)) if (memq (char-before) '(nil ?\s ?\t ?\n))
finally return pt)) return t))
#'<) #'<)
(let ((indentation (current-indentation))) (let ((indentation (current-indentation)))
(when (and (not (memq indentation collected-indentations)) (when (and (not (memq indentation collected-indentations))