From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: 56135@debbugs.gnu.org
Cc: "João Távora" <joaotavora@gmail.com>
Subject: bug#56135: 29.0.50; python.el - forward-sexp regression over triple-quoted strings
Date: Wed, 22 Jun 2022 08:50:44 +0200 [thread overview]
Message-ID: <875yktgpiz.fsf@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]
Hi!
I believe this commit:
2021-09-21 "Make syntax-ppss more accurate for Python triple quotes
(bug#49518)" (0646c68171)
… introduced a regression for users who set python-forward-sexp-function
to nil (or users who set forward-sexp-function buffer-locally, as was
suggested by python.el's commentary before Emacs 28.1).
To reproduce:
$ echo '"""Quotes for days"""' > repro.py
$ emacs -Q -eval '(setq python-forward-sexp-function nil)' repro.py
; C-M-f
- Point should move to position 22,
- As of the above commit, it lies at position 3.
(Note: if one visits the file before setting the user option, the
setting will not be taken into account; to reproduce, one should then
either set forward-sexp-function directly, or revert the buffer)
I've attached an ert test for this recipe; it passes when run against
0646c68171^ (i.e. the parent commit) and fails as of 0646c68171.
I haven't started to dig into what the change meant to fix, so I cannot
say whether TRT would be to keep the change and improve on it or revert
the change and fix the original problem some other way.
Let me know if I can assist further; thanks for your time.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ert-python-forward-sexp.patch --]
[-- Type: text/x-patch, Size: 630 bytes --]
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index e17bc0df92..7243eb0e59 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -2763,6 +2763,13 @@ python-nav-forward-sexp-safe-1
(python-nav-forward-sexp-safe 1)
(should (looking-at "$"))))
+(ert-deftest python-nav-forward-sexp-nil ()
+ (let ((python-forward-sexp-function nil))
+ (python-tests-with-temp-buffer
+ "'''A docstring.'''"
+ (forward-sexp nil t)
+ (should (= (point) 19)))))
+
(ert-deftest python-nav-up-list-1 ()
(python-tests-with-temp-buffer
"
[-- Attachment #3: Type: text/plain, Size: 828 bytes --]
In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0)
of 2022-05-08 built on amdahl30
Repository revision: e8ed4317e879683872d956cc919d0957fff18531
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: openSUSE Tumbleweed
Configured using:
'configure --with-cairo --with-gconf --with-sqlite3 --with-xinput2'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
Important settings:
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=local
locale-coding-system: utf-8-unix
next reply other threads:[~2022-06-22 6:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-22 6:50 Kévin Le Gouguec [this message]
[not found] ` <CALDnm50Mp21dyo899GC7oJHL+sSzF9JaUJty3xUgPAHm=k=_RA@mail.gmail.com>
[not found] ` <877d58juup.fsf@gmail.com>
[not found] ` <87y1xotlna.fsf@gmail.com>
2022-06-22 22:19 ` bug#56135: 29.0.50; python.el - forward-sexp regression over triple-quoted strings João Távora
2022-06-23 6:49 ` Kévin Le Gouguec
2022-06-23 6:53 ` bug#56135: [Kévin Le Gouguec] " Kévin Le Gouguec
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=875yktgpiz.fsf@gmail.com \
--to=kevin.legouguec@gmail.com \
--cc=56135@debbugs.gnu.org \
--cc=joaotavora@gmail.com \
/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).