From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Newsgroups: gmane.emacs.bugs Subject: bug#56135: 29.0.50; python.el - forward-sexp regression over triple-quoted strings Date: Wed, 22 Jun 2022 08:50:44 +0200 Message-ID: <875yktgpiz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22119"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: 56135@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 22 08:52:17 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3uDo-0005WZ-Lm for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Jun 2022 08:52:16 +0200 Original-Received: from localhost ([::1]:55774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3uDn-0005IQ-HF for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Jun 2022 02:52:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3uDb-0005GJ-0Q for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2022 02:52:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3uDa-0001bf-Ns for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2022 02:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o3uDa-0006ki-Mk; Wed, 22 Jun 2022 02:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: joaotavora@gmail.com, bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Jun 2022 06:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56135 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Received: via spool by submit@debbugs.gnu.org id=B.165588066825873 (code B ref -1); Wed, 22 Jun 2022 06:52:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Jun 2022 06:51:08 +0000 Original-Received: from localhost ([127.0.0.1]:33837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3uCg-0006jC-Hy for submit@debbugs.gnu.org; Wed, 22 Jun 2022 02:51:08 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3uCU-0006iW-3g for submit@debbugs.gnu.org; Wed, 22 Jun 2022 02:51:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3uCS-0004ee-A9 for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2022 02:50:53 -0400 Original-Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:40944) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3uCP-0001Q0-HB for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2022 02:50:52 -0400 Original-Received: by mail-wr1-x42f.google.com with SMTP id w17so21926884wrg.7 for ; Tue, 21 Jun 2022 23:50:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=vmvO4YIWSb4wvPCs7hQlZo/Wgpa7VZ5b57IS8Lt2h1w=; b=f0Z0m2T68AvlUXQXrMYgbv8fYq5nGtA2soHmBgxq39Lmfx6eU3aYXtJfhojqDoE0sO swcbxYxWeyCeTryCNj5L/rAKxxgxgt7nasJaTEilxdDigBsvtXDBtpBw/sGdJrDygCst 5q07Mln4jlTb5uoVFE0w7M9QcgHJgoixAZomDCKJHPqqIVv6vO9feqFeaKkaJrpTUZah bSp9wxFpki+IMn9yzAVVF4AK3v5ZIvkhwNQ8THDImHTE/JyHtn5BDMKM6LQJjMEIDUAu ElvGkIU/Ybzs9F+E6k0gzLObbdb9g1bLttTVx2S+Q/Jo/6zN+Tn727NXRXHg5I1ZVOZb anXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=vmvO4YIWSb4wvPCs7hQlZo/Wgpa7VZ5b57IS8Lt2h1w=; b=bNTKbChQK+cMr/WyIBNAZ4JWd44A2v2iKhAgc2IlOz3044xczglL6AXw6wv31XZBFq Mx0LmzBFEPRUXLwmvBmKLtkzI2qzEZfpH6/i8ism3geA2H7XdYpQ96pP5tsQfK1zNI3w xCjOFzrNXi0O5Hq3jrlbYPw+LJtG/rnmFcb8KPUriewy0/SmRMmxoTacLyzbU1GXJX5D zjdvodsJaJm0muQRnwOS13lcltOvP1Rcn5CpIgGLdM7+wOLo85xYwtwRIJiAKTo0WFsA pB1Ry6wix8S1keQuFfDL5XPML8xbjwQqhY5teMg5itAqu+uDG9XA7bR8XadsrPcWiLTI 0OUg== X-Gm-Message-State: AJIora9LQ6cGyCeNZHJVTZo9Eq6uDnsAqOUAhEy6enTEKYUpJ8Jxi33W lm6+7F2RIQinLowU3F6fotuyHZRC30o= X-Google-Smtp-Source: AGRyM1ve2ZqMNbxbsVa9M44NybluVKAGAuJLwoLyERR9URR58K+H/xrf9fztSn26i3gcLaKdJ1xSDg== X-Received: by 2002:adf:f84a:0:b0:21b:88b8:183 with SMTP id d10-20020adff84a000000b0021b88b80183mr1671745wrq.265.1655880646235; Tue, 21 Jun 2022 23:50:46 -0700 (PDT) Original-Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id e1-20020a5d5941000000b0020c5253d907sm18142049wri.83.2022.06.21.23.50.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jun 2022 23:50:45 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=kevin.legouguec@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235003 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! I believe this commit: 2021-09-21 "Make syntax-ppss more accurate for Python triple quotes (bug#49518)" (0646c68171) =E2=80=A6 introduced a regression for users who set python-forward-sexp-fun= ction 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=ert-python-forward-sexp.patch 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 " --=-=-= Content-Type: text/plain 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 --=-=-=--