unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tom Gillespie <tgbugs@gmail.com>
To: 56271@debbugs.gnu.org
Cc: Lars Ingebrigtsen <larsi@gnus.org>
Subject: bug#56271: lisp/progmodes/python.el; unmatched quotes cause infinite loop freezing emacs
Date: Tue, 28 Jun 2022 20:00:24 -0700	[thread overview]
Message-ID: <CA+G3_PO9frF19sA5GEnSeHZTjYhrNotgaHJAJ2fEmni0nm9+sw@mail.gmail.com> (raw)
In-Reply-To: <CA+G3_PNpJOkCu0iEdtzd0jTZ0DbBUcLJrS6nMwti8-NW7E0uKQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 55 bytes --]

Patch to add a test using the evil file as an example.

[-- Attachment #2: 0001-test-lisp-progmodes-python-tests.el-add-test-for-nav.patch --]
[-- Type: text/x-patch, Size: 1157 bytes --]

From 2c6eb7793b8938d2cce413499a62716a87163a29 Mon Sep 17 00:00:00 2001
From: Tom Gillespie <tgbugs@gmail.com>
Date: Tue, 28 Jun 2022 19:55:31 -0700
Subject: [PATCH] test/lisp/progmodes/python-tests.el: add test for nav end of
 block

Add test for python-nav-end-of-block to prevent regression of bug#56271.
---
 test/lisp/progmodes/python-tests.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index e17bc0df92..c59a2e7953 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -2565,6 +2565,18 @@ python-nav-end-of-block-1
                 (python-tests-look-at "print 'After f(*args)'")
                 (line-end-position))))))
 
+(ert-deftest python-nav-end-of-block-2 ()
+  "Ensure that `python-nav-end-of-block' does not enter an infinite loop."
+  (python-tests-with-temp-buffer
+   "def
+    =''
+ '
+\"\"\"\"\"\"
+ #
+''
+"
+   (python-nav-end-of-block)))
+
 (ert-deftest python-nav-forward-block-1 ()
   "This also accounts as a test for `python-nav-backward-block'."
   (python-tests-with-temp-buffer
-- 
2.35.1


  reply	other threads:[~2022-06-29  3:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28  1:51 bug#56271: lisp/progmodes/python.el; unmatched quotes cause infinite loop freezing emacs Tom Gillespie
     [not found] ` <87lethroiv.fsf@gnus.org>
     [not found]   ` <CA+G3_POGKF-fDfBuxNcc93WSEaaYzAd4FSgk-vKy=tQYOXYtHg@mail.gmail.com>
2022-06-29  2:45     ` Tom Gillespie
2022-06-29  3:00       ` Tom Gillespie [this message]
2022-06-29 10:14       ` Lars Ingebrigtsen
2022-09-05 19:34         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+G3_PO9frF19sA5GEnSeHZTjYhrNotgaHJAJ2fEmni0nm9+sw@mail.gmail.com \
    --to=tgbugs@gmail.com \
    --cc=56271@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).