From: Dmitry Gutov Date: Wed, 8 Mar 2023 22:43:31 +0000 (+0200) Subject: Avoid potential infloop X-Git-Tag: emacs-29.0.90~217 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c2ca009da4c;p=emacs.git Avoid potential infloop * lisp/progmodes/python.el (python-info-dedenter-opening-block-positions): Avoid potential infloop (bug#62031). --- diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 81475f31f60..630250c15c3 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5792,9 +5792,9 @@ likely an invalid python file." (catch 'exit (while (python-nav--syntactically (lambda () - (cl-loop for pt = (re-search-backward (python-rx block-start) nil t) - until (memq (char-before) '(nil ?\s ?\t ?\n)) - finally return pt)) + (cl-loop while (re-search-backward (python-rx block-start) nil t) + if (memq (char-before) '(nil ?\s ?\t ?\n)) + return t)) #'<) (let ((indentation (current-indentation))) (when (and (not (memq indentation collected-indentations))