unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56135: 29.0.50; python.el - forward-sexp regression over triple-quoted strings
@ 2022-06-22  6:50 Kévin Le Gouguec
       [not found] ` <CALDnm50Mp21dyo899GC7oJHL+sSzF9JaUJty3xUgPAHm=k=_RA@mail.gmail.com>
  2022-06-23  6:53 ` bug#56135: [Kévin Le Gouguec] " Kévin Le Gouguec
  0 siblings, 2 replies; 4+ messages in thread
From: Kévin Le Gouguec @ 2022-06-22  6:50 UTC (permalink / raw)
  To: 56135; +Cc: João Távora

[-- 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-23  6:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22  6:50 bug#56135: 29.0.50; python.el - forward-sexp regression over triple-quoted strings Kévin Le Gouguec
     [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       ` 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

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).