From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Rob Moss Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Mar 2023 08:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62031@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16781792757992 (code B ref -1); Tue, 07 Mar 2023 08:55:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Mar 2023 08:54:35 +0000 Received: from localhost ([127.0.0.1]:44421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZT5d-00024o-M2 for submit@debbugs.gnu.org; Tue, 07 Mar 2023 03:54:35 -0500 Received: from lists.gnu.org ([209.51.188.17]:36136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZPCP-0003nR-Vj for submit@debbugs.gnu.org; Mon, 06 Mar 2023 23:45:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZPCH-00065R-82 for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 23:45:14 -0500 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZPCD-0007lc-6R for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 23:45:08 -0500 Received: by mail-pj1-x1042.google.com with SMTP id kb15so12078223pjb.1 for ; Mon, 06 Mar 2023 20:45:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678164303; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=hQVTGnu+NlNo1JirLUu4L1jG+wgReamixMe5yQe8f78=; b=e/H1SFjYsAWMjQt8LQIkP8JRPo3GGdvTV5UlY2WVDUx2D8okyeyLaI9YU9NrZxjA9d i3fX8b08FoLYYtLyutXs9y5TeAvT2KAAHTWn/30JjE8Vajyhj+Q+lkWdQwaQoQ7sZI/W TQsmu9X1dVKlHORpL+58TP7LoaYmHl/9JOgaeTZYBNSU3oI7w0ZKseWA5RJ7ihe8hZEQ afDH7IUe3FA2DIr1Njm5p0yI47rM/nCwWqtli0bHoWAwf2EdHaSoOj/w02bDUykMXUmz N37xnHZZz7S1EhIEDD4YfyGR1B76dijfkgtiybyRcwnKepleb13x8LKgzrJ4/Zxo6OVe aIfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678164303; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=hQVTGnu+NlNo1JirLUu4L1jG+wgReamixMe5yQe8f78=; b=zJtqJ8x9Un0r5VKd6vsKvU6Ze+Lr8dkfHOMcSKLkpeNxhzGZXE1mROYy7q8mns0YUf iDS7kJq+PCZy/h/fnL7K4+3Wz/5I8UxhIHRwQZY6n3yXh2n/0kVc2I7ulrutzQNJf594 lbrvxkG1NV4glR6UFQTp7Kr/GWFpQXSka2UQLy5ibGhlgWqPuV1nxeEXNEf8knsvXpzx q0+2J4cucf9XYLURqpLB0NU59TSOY7FQYVKSaJNEvo98RYCPtHTSWX74viiOvTTxR6Tj w0j4JNtbE48/vlvdzvbu1lKIt3mAFhba1WfbHxr3viWsOISYKt0ojpKu0o6gtLgPW+W4 LRFw== X-Gm-Message-State: AO0yUKVDmGMbwc++9XyCNMcq73aafTkEpaHZhzi2Um8Y6WcRgTRsGUbB IV9j7wsTPJ8cKAbSP/pZDaQuf3PzPvEfYLBYxBJkZXHv+qpnGJR4yW8= X-Google-Smtp-Source: AK7set8DWN8vHoN2DHpGybpUTX4CsvBvaFZ4TbylCi4D8rJw7pZK0pvEnDMQ1IHXrYZYJZnq7lBV4JxLFGgIQpaSLlg= X-Received: by 2002:a17:902:efce:b0:19b:5233:51d8 with SMTP id ja14-20020a170902efce00b0019b523351d8mr5400831plb.13.1678164302857; Mon, 06 Mar 2023 20:45:02 -0800 (PST) MIME-Version: 1.0 From: Rob Moss Date: Tue, 7 Mar 2023 15:44:51 +1100 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::1042; envelope-from=robm.dev@gmail.com; helo=mail-pj1-x1042.google.com X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 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, LONGWORDS=2.035, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URI_HEX=0.1 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.6 (/) X-Mailman-Approved-At: Tue, 07 Mar 2023 03:54:32 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi there, Starting from 'emacs -Q' I do the following: 1. Visit a new Python file ("~/test.py", say); 2. Enter the following lines: ---------------------------------------- import re def test_re(string): if re.match('^[a-c]+$', string): print('yes') else: print('no') ---------------------------------------- 3. Place the cursor on the "else:" line and press . This has the following effect on the buffer contents: ---------------------------------------- import re def test_re(string): if re.match('^[a-c]+$', string): print('yes') else: print('no') ---------------------------------------- Pressing repeatedly has no effect, this incorrect indentation is the only indentation it allows. I experience this issue with "python-mode" and "python-ts-mode", but if I change "re.match" to "re.matches", the correct indentation is preserved. So presumably the "match" in "re.match" is being treated as a match statement. All the best, Rob In GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2023-02-24 built on 5050l-202293-l.mobility.unimelb.net.au Repository revision: 94e70ed4261dbfcef679697dfa0dc2348a90dbdc Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: Ubuntu 20.04.5 LTS Configured using: 'configure --with-native-compilation --with-json --with-cairo --with-tree-sitter --with-sqlite3 --prefix=/opt/emacs29 CFLAGS=-O2' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_AU.UTF-8 locale-coding-system: utf-8-unix Major mode: Python Minor modes in effect: consult-org-roam-mode: t org-roam-db-autosync-mode: t flyspell-mode: t pdf-occur-global-minor-mode: t pyvenv-mode: t smartparens-global-mode: t smartparens-mode: t global-company-mode: t company-mode: t global-flycheck-mode: t flycheck-mode: t recentf-mode: t desktop-save-mode: t global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t global-diff-hl-mode: t diff-hl-mode: t vertico-multiform-mode: t vertico-mode: t savehist-mode: t marginalia-mode: t mood-line-mode: t which-key-mode: t global-hl-todo-mode: t hl-todo-mode: t olivetti-mode: t delete-selection-mode: t global-hl-line-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t context-menu-mode: t global-font-lock-mode: t font-lock-mode: t line-number-mode: t visual-line-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Features: (shadow mail-extr emacsbug cl-print rst shortdoc help-fns radix-tree pulse skeleton misearch multi-isearch latexenc oc-basic rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid nxml-mode nxml-outln nxml-rap sgml-mode facemenu make-mode cal-move ess-sp6-d tabify ucs-normalize org-roam-boxes consult-org-entity embark-org embark-consult embark consult-org consult-org-roam consult-org-roam-buffer f consult-vertico consult compat-28 org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id org-roam-node org-roam-db org-roam-utils org-roam-compat org-roam org-capture org-attach emacsql-sqlite url-http url-auth url-gw novice vertico-directory mule-util conf-mode sh-script smie cursor-sensor reftex-dcr reftex reftex-loaddefs reftex-vars tex-mode mixed-pitch adaptive-wrap reveal org-superstar ox-beamer ffap ol-eww eww url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo gnus-spec gnus-int gnus-range gnus-win gnus nnheader range ol-docview doc-view ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi outshine outshine-org-cmds outorg ox-jfm ox-gfm ox-md ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar org-agenda ox-html table ox-ascii ox-publish ox org-element org-persist xdg org-id org-refile avl-tree ob-shell ob-dot ob-R ob-python ob-haskell org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete org-list org-footnote org-faces org-entities ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs cal-menu calendar cal-loaddefs org-version org-compat org-macs eglot external-completion array jsonrpc ert debug backtrace python-blue python compat treesit init sanityinc-tomorrow-night-theme executable vc-git whitespace face-remap flyspell ispell sort gnutls nsm dns elpher pdf-occur ibuf-ext ibuffer ibuffer-loaddefs pdf-isearch let-alist pdf-misc pdf-tools pdf-view magit-bookmark bookmark jka-compr pdf-cache pdf-info tq pdf-util pdf-macs image-mode exif tablist tablist-filter semantic/wisent/comp semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet mastodon-alt mastodon-media url-cache mastodon-tl ts s mastodon shr pixel-fill kinsoku url-file svg dom mastodon-toot mastodon-iso persist mastodon-http request ffmpeg-elf yaml-mode emacsql-sqlite-builtin sqlite emacsql-sqlite-common emacsql emacsql-compiler xml bibtex rust-mode poly-R ess-r-mode ess-r-flymake flymake-proc flymake ess-r-xref ess-trns ess-r-package ess-r-completion ess-roxy ess-r-syntax ess-rd hideshow ess-s-lang ess-help ess-mode ess-inf ess-tracebug compile tramp tramp-loaddefs trampver tramp-integration tramp-compat parse-time iso8601 ls-lisp poly-noweb poly-markdown markdown-mode noutline outline polymode poly-lock polymode-base polymode-weave polymode-export polymode-compat polymode-methods polymode-core polymode-classes eieio-custom eieio-base ess lisp-mnt ess-utils ess-custom pyvenv eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util cus-edit pp cus-load files-x driverr smartparens thingatpt company-oddmuse company-keywords company-etags etags fileloop generator xref project company-gtags company-dabbrev-code company-dabbrev company-files company-capf company-cmake company-xcode company-clang company-semantic company-eclim company-template company-bbdb company flycheck find-func recentf tree-widget wid-edit desktop frameset magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff git-commit log-edit message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell pcomplete comint ansi-osc ring server ansi-color magit-mode transient format-spec magit-git magit-section magit-utils crm diff-hl vc-dir ewoc vc vc-dispatcher diff-mode vertico-multiform vertico savehist orderless marginalia edmacro kmacro emojify advice apropos tar-mode arc-mode archive-mode pcase ht dash mood-line undo-fu hercules which-key hl-todo color-theme-sanityinc-tomorrow color olivetti delsel hl-line comp comp-cstr warnings icons cl-extra help-mode use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core undo-fu-autoloads haskell-mode-autoloads consult-dir-autoloads python-blue-autoloads emacsql-sqlite-builtin-autoloads mastodon-autoloads persist-autoloads consult-org-entity-autoloads pdf-tools-autoloads orderless-autoloads consult-org-roam-autoloads which-key-autoloads olivetti-autoloads smartparens-autoloads rx flycheck-autoloads org-roam-autoloads emacsql-sqlite-autoloads emacsql-autoloads finder-inf color-theme-sanityinc-tomorrow-autoloads citar-embark-autoloads citar-autoloads citeproc-autoloads string-inflection-autoloads parsebib-autoloads queue-autoloads embark-consult-autoloads embark-autoloads marginalia-autoloads vertico-autoloads polymode-autoloads ess-autoloads consult-autoloads compat-autoloads ts-autoloads info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib early-init rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 1904084 978312) (symbols 48 62463 106) (strings 32 307966 100211) (string-bytes 1 10375851) (vectors 16 147394) (vector-slots 8 3144694 1170710) (floats 8 905 2495) (intervals 56 45653 40421) (buffers 984 67)) From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Mar 2023 14:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Rob Moss , 62031@debbugs.gnu.org, Lele Gaifax Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.167819973420456 (code B ref 62031); Tue, 07 Mar 2023 14:36:01 +0000 Received: (at 62031) by debbugs.gnu.org; 7 Mar 2023 14:35:34 +0000 Received: from localhost ([127.0.0.1]:44942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZYPe-0005Jr-DA for submit@debbugs.gnu.org; Tue, 07 Mar 2023 09:35:34 -0500 Received: from mail-wr1-f47.google.com ([209.85.221.47]:40870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZYPc-0005Ja-3w for 62031@debbugs.gnu.org; Tue, 07 Mar 2023 09:35:33 -0500 Received: by mail-wr1-f47.google.com with SMTP id t15so12326329wrz.7 for <62031@debbugs.gnu.org>; Tue, 07 Mar 2023 06:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678199726; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=f3v4U9EjovubsOsmXs2NUTlYvljPJ1XrXMp+3/ehu20=; b=dRqzyLivSvmVfiVPd4Vkvj9jndhrnxUXGVhD9uNTkPR8npG0H3akYQgl/7u+oPu6Rc ITlqf65meRdpJ+sTWoyhbnQX94S00b2D9JkdeJUVEa8PjUYRU2UntN9qAvbTHMnfdBbQ xzadC17B169S2OYvULz1WB977qgtjB/DcuHkUkEDhRqa2B7k0iCZ1SX1BY4K5pLZGmMJ dRrPwKNbl+ZZSiOOl/1OuFOAORbERaeTngatVDtkZLZuFKN9MVBW4buFfn2xO+p8KkFH yqgI4/6GS8VO5Wgp8iGOwkvu/HwfqHNo70+8etdZ/2oXhTR+R+q9Y2mZaETg1oJBahoZ bBXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678199726; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f3v4U9EjovubsOsmXs2NUTlYvljPJ1XrXMp+3/ehu20=; b=Oq+J4V0/6KUu5688zIkP/6MPlgpeC5KKLPt2zM43v9QBvOaLKzirdc1oOdOaBdOvj1 AmtuU0R4hZtAYXXkESNSxUe4KdSiK+0aUDBw8JET9ZU9/yPivWigEDvEpcn7gASKND11 GO76Dq79APsbzz6fbEaR7dduIwRYKGmSt7LZ8YA+oK6YDTLK5Oz+3xev9glJFHitV/2I 4SDyZMuJomlfhEp+AxGXclnOTSXBt4OT4gSSURipjnZrQXmi4nbDkmmea4gQBHpT4udN yRYErLUCjYnGBPLsk64EhC9luv/qRMJbjiNiYJ1zI8AeGyHBW1E4PKHMlhIGTSAFfvDR 0kSw== X-Gm-Message-State: AO0yUKV3RZyYrT2v4JH1W83Ps2nKPtkWdhWHiYTY1Bmqk2pa6Fyn9Dya UquPWEiAqUo091S7PnqNsQ4= X-Google-Smtp-Source: AK7set80dYUuVxoBbKtRHxn+dNziwJ+4R8A/eHgCFoQBsuAC3LlnAfc3hMJQElWPcwH5hb7NI1Wxlw== X-Received: by 2002:a5d:6689:0:b0:2c7:a39:7453 with SMTP id l9-20020a5d6689000000b002c70a397453mr10006803wru.54.1678199726048; Tue, 07 Mar 2023 06:35:26 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id j2-20020a5d6042000000b002c70d269b4esm12536196wrt.91.2023.03.07.06.35.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Mar 2023 06:35:25 -0800 (PST) Message-ID: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> Date: Tue, 7 Mar 2023 16:35:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US References: From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) Hi! Thanks for the report. On 07/03/2023 06:44, Rob Moss wrote: > Hi there, > > Starting from 'emacs -Q' I do the following: > > 1. Visit a new Python file ("~/test.py", say); > > 2. Enter the following lines: > > ---------------------------------------- > import re > > def test_re(string): > if re.match('^[a-c]+$', string): > print('yes') > else: > print('no') > ---------------------------------------- > > 3. Place the cursor on the "else:" line and press . > > This has the following effect on the buffer contents: > > ---------------------------------------- > import re > > def test_re(string): > if re.match('^[a-c]+$', string): > print('yes') > else: > print('no') > ---------------------------------------- > > Pressing repeatedly has no effect, this incorrect indentation is > the only indentation it allows. > > I experience this issue with "python-mode" and "python-ts-mode", but > if I change "re.match" to "re.matches", the correct indentation is > preserved. So presumably the "match" in "re.match" is being treated as > a match statement. In python-mode, this is a regression from commit 35d0190b0b91c085c73bbe6c2b8e93ea8288b589 Author: Lele Gaifax Date: Sun May 22 10:44:31 2022 +0200 Properly indent Python PEP634 match/case blocks <...> The addition of "match" in python-rx has that effect. How to fix this without reverting the feature, is not immediately obvious to me, so I'm Cc'ing the author of that commit. python-ts-mode reuses indentation code from python-mode, so it's no coincidence that is shares the problem. From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Lele Gaifax Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Mar 2023 14:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , Rob Moss , 62031@debbugs.gnu.org Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.167820104624883 (code B ref 62031); Tue, 07 Mar 2023 14:58:01 +0000 Received: (at 62031) by debbugs.gnu.org; 7 Mar 2023 14:57:26 +0000 Received: from localhost ([127.0.0.1]:46923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZYko-0006TH-Da for submit@debbugs.gnu.org; Tue, 07 Mar 2023 09:57:26 -0500 Received: from orphu.arstecnica.it ([178.63.97.204]:33368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZYkl-0006T6-KT for 62031@debbugs.gnu.org; Tue, 07 Mar 2023 09:57:24 -0500 From: Lele Gaifax DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metapensiero.it; s=mail; t=1678201041; bh=y9TJ/IQwvLSOhmUaVtpoe7tGYfPXI9Afc7UP19SNB58=; h=From:To:Subject:In-Reply-To:References:Date; b=etfA9TgnFrDnUOrJdN/D72j6perDNCfw3vQVyZsqP3h3WBVCHd+CJzQudNu8qdqFL 8c4saCl1QI5paCarUVye+kcLLb06GlNhYQPOnBUxN2ODTsZPRuAO0v3OVgCYVNk0PS O71k28XMiKqmqQFHuqFrrXclxBal/m3kknGkH+f8= In-Reply-To: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> Date: Tue, 07 Mar 2023 15:57:19 +0100 Message-ID: <87bkl4y5gw.fsf@metapensiero.it> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thank you for the head up, I will try to understand the issue and hopefully fix the problem as time permits. ciao, lele. --=20 nickname: Lele Gaifax | Dire che Emacs =C3=A8 "conveniente" =C3=A8 come real: Emanuele Gaifas | etichettare l'ossigeno come "utile" lele@etour.tn.it | -- Rens Troost From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Lele Gaifax Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Mar 2023 07:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62031@debbugs.gnu.org Cc: Rob Moss , Dmitry Gutov Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.16782620063477 (code B ref 62031); Wed, 08 Mar 2023 07:54:02 +0000 Received: (at 62031) by debbugs.gnu.org; 8 Mar 2023 07:53:26 +0000 Received: from localhost ([127.0.0.1]:47700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZoc1-0000tw-Vk for submit@debbugs.gnu.org; Wed, 08 Mar 2023 02:53:26 -0500 Received: from orphu.arstecnica.it ([178.63.97.204]:58244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZobz-0000tk-HW for 62031@debbugs.gnu.org; Wed, 08 Mar 2023 02:53:24 -0500 From: Lele Gaifax DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metapensiero.it; s=mail; t=1678262001; bh=B3JoQtmuIQ3fPKKK87drWG27RTruRtNIndCc3lfiTrk=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=NU/ZIz0LAMeZPXJepwAvnf5jRgnOLT2PitsuMVXkMf6G469hyUO34qp0b6j8x6pSu stZLc+ncsUdbgo6MhCM6My8kf8SCVyk9EC80LjJg+dXSAP8VOx41TN7UUr5az8M7rz YGyf5ccI79DA/5eiPLO01dDJHpCUUmbx2LpVhAwc= In-Reply-To: References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> Date: Wed, 08 Mar 2023 08:53:19 +0100 Message-ID: <87wn3rk7bk.fsf@metapensiero.it> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) I had a quick glance at this, and while I can confirm the problem with the following test diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 4f24c042c6a..9926c4b002f 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -1982,6 +1982,17 @@ python-virt-bin (should (eq (car (python-indent-context)) :after-block-start)) (should (= (python-indent-calculate-indentation) 8)))) +(ert-deftest python-indent-after-re-match () + "Test BUG 62031 regression." + (python-tests-with-temp-buffer + " +def test_re(string): + if re.match('^[a-c]+$', string): + print('yes') + else: +" + (python-tests-look-at "else:") + (should (= (python-indent-calculate-indentation) 4)))) I could not figure out how this can be fixed, with my current knowledge on python.el. There are several places where the regexp produced by `(python-rx block-start)' is used, many within a `(looking-at ...)' form and several others in a `(re-search-forward ...)': given that block starting "keywords" are required to be at the beginning of a line, possibly preceded by whitespace, I think that the problem may arise from those usages which do not explicitly enforce the constraint, but unfortunately all my attempts to do that a) didn't make the test above green and b) broke one or more of the other tests. I will try again, but I'm afraid this will go beyond my current spare time availability. bye, lele. From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Ruijie Yu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Mar 2023 13:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lele Gaifax Cc: Rob Moss , Dmitry Gutov , 62031@debbugs.gnu.org Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.167828196314192 (code B ref 62031); Wed, 08 Mar 2023 13:27:02 +0000 Received: (at 62031) by debbugs.gnu.org; 8 Mar 2023 13:26:03 +0000 Received: from localhost ([127.0.0.1]:48047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZtnu-0003gp-OP for submit@debbugs.gnu.org; Wed, 08 Mar 2023 08:26:03 -0500 Received: from netyu.xyz ([152.44.41.246]:58316 helo=mail.netyu.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZtns-0003gQ-Sd for 62031@debbugs.gnu.org; Wed, 08 Mar 2023 08:26:01 -0500 Received: from fw.net.yu.netyu.xyz ( [222.248.4.98]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 459478a8 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 8 Mar 2023 13:25:58 +0000 (UTC) References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> <87wn3rk7bk.fsf@metapensiero.it> User-agent: mu4e 1.8.14; emacs 30.0.50 From: Ruijie Yu Date: Wed, 08 Mar 2023 21:23:58 +0800 In-reply-to: <87wn3rk7bk.fsf@metapensiero.it> Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Lele Gaifax writes: > [...] > + if re.match('^[a-c]+$', string): > + print('yes') > + else: > [...] I think you might want to add a variation to this test, like this: from re import match if match(...): pass -- Best, RY From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Mar 2023 13:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lele Gaifax , kobarity Cc: robm.dev@gmail.com, dgutov@yandex.ru, 62031@debbugs.gnu.org Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.167828365317223 (code B ref 62031); Wed, 08 Mar 2023 13:55:01 +0000 Received: (at 62031) by debbugs.gnu.org; 8 Mar 2023 13:54:13 +0000 Received: from localhost ([127.0.0.1]:48079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZuFB-0004Tj-9e for submit@debbugs.gnu.org; Wed, 08 Mar 2023 08:54:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZuF9-0004TW-0j for 62031@debbugs.gnu.org; Wed, 08 Mar 2023 08:54:11 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZuF2-0003MH-NG; Wed, 08 Mar 2023 08:54:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/kctGSb8IJZZtu6QZR94XtKLgB91Jlncx+9Wjhkl3/I=; b=XcGcY/AhGfpL TzuWMJ5JmrV0+t29RyHFrf2gXnx6YAIY10sX7vYonISUuoT1wgGOpxm/IzQZsiu1HwKZYsWCkhU03 fKvv4DBfo6CBknyI8/dmoyoILWzeZi/dxgARiLDzsdAIN0Sgpw/7gn9O3Fln89ahrhADFC9p2GKj3 8XkaCqW8wsXLAltQKvnTbH9OL+2nWzGXUXItIoMbrwhP4fvFU8/QcA1Ezs8mI0dVK/1OJySnsywBL OnegMe19ZFnsVyn4m9E6Tlv2wzAhrrBty2Ks+/5Pm+FmuHRIKEsNIBGB7i9YlnKDpnR/abudPt52p wxpDSyTGVr6ggvXFKT1GCA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZuF1-0003wT-UK; Wed, 08 Mar 2023 08:54:04 -0500 Date: Wed, 08 Mar 2023 15:54:03 +0200 Message-Id: <83wn3r4adg.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87wn3rk7bk.fsf@metapensiero.it> (message from Lele Gaifax on Wed, 08 Mar 2023 08:53:19 +0100) References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> <87wn3rk7bk.fsf@metapensiero.it> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Rob Moss , Dmitry Gutov > From: Lele Gaifax > Date: Wed, 08 Mar 2023 08:53:19 +0100 > > I had a quick glance at this, and while I can confirm the problem with > the following test > > diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el > index 4f24c042c6a..9926c4b002f 100644 > --- a/test/lisp/progmodes/python-tests.el > +++ b/test/lisp/progmodes/python-tests.el > @@ -1982,6 +1982,17 @@ python-virt-bin > (should (eq (car (python-indent-context)) :after-block-start)) > (should (= (python-indent-calculate-indentation) 8)))) > > +(ert-deftest python-indent-after-re-match () > + "Test BUG 62031 regression." > + (python-tests-with-temp-buffer > + " > +def test_re(string): > + if re.match('^[a-c]+$', string): > + print('yes') > + else: > +" > + (python-tests-look-at "else:") > + (should (= (python-indent-calculate-indentation) 4)))) > > I could not figure out how this can be fixed, with my current knowledge > on python.el. > > There are several places where the regexp produced by `(python-rx > block-start)' is used, many within a `(looking-at ...)' form and several > others in a `(re-search-forward ...)': given that block starting > "keywords" are required to be at the beginning of a line, possibly > preceded by whitespace, I think that the problem may arise from those > usages which do not explicitly enforce the constraint, but unfortunately > all my attempts to do that a) didn't make the test above green and b) > broke one or more of the other tests. > > I will try again, but I'm afraid this will go beyond my current spare > time availability. Thank you for your efforts. kobarity, any ideas or suggestions? From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Rob Moss Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Mar 2023 15:39:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lele Gaifax Cc: 62031@debbugs.gnu.org, Dmitry Gutov Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.167828991930180 (code B ref 62031); Wed, 08 Mar 2023 15:39:03 +0000 Received: (at 62031) by debbugs.gnu.org; 8 Mar 2023 15:38:39 +0000 Received: from localhost ([127.0.0.1]:49973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZvsF-0007qb-1a for submit@debbugs.gnu.org; Wed, 08 Mar 2023 10:38:39 -0500 Received: from mail-pg1-f180.google.com ([209.85.215.180]:44838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZgmO-0001ls-SN for 62031@debbugs.gnu.org; Tue, 07 Mar 2023 18:31:37 -0500 Received: by mail-pg1-f180.google.com with SMTP id 16so8605417pge.11 for <62031@debbugs.gnu.org>; Tue, 07 Mar 2023 15:31:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678231891; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DyeAluRJt+/muH4yXGl5irCi7dgS+oMnISr8b6/vrPc=; b=YigsefAlVWcr7I6B/QePmqwtper9n7/7MLIJt/9wofDdkgBKDEjB7mabQWIyMIb8va jTGtsbDFTKfO5uFDcfZx2+6/S/lAux5v8iu2xc5vHN51yGQcySMZZXmP5R5ObKU98+NU PQ8MLpkgFANyEVThftSuTRctbqkEMsddqOiGOBWr5y/Tz+n7qTivH8tXsLpaOH+Pgyr1 1989MrY14C+k9h2IFCWfYyRHo2U2+UiXTNGX7ynZDdBd2/plC1XEKftsQP2SFilGq3Ea M77GS0m8EioyA1IjO2p+U3GV+OHdvL9Ckzipnmj761YkMc3raPEd/iFaIWM7G+dNjCZg UCRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678231891; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DyeAluRJt+/muH4yXGl5irCi7dgS+oMnISr8b6/vrPc=; b=u0MvC+x76cUeHqxJa/sSgbacXgr3hQR7hvjJ8gdPUElm3UjEKybWTfo2UHRguSg+ft 4kKH3kBSNTNsfs9zs6pYPkWv/cRVZEh0pqsxyJ6BD4PhmTOkLoAc8QbN8mmCNuHu++tt NbwIi91HCSj90y1Dj0c9Ev6JmZINP4BH9aSvu4AwauFlYW5RtAjHG/vnqOvgnAvBy0vF xXarZfOFDb4L0vyL8IUovY+I2iQrq01AHLXVDHxgfYOznEuPliNhlDO/5cG9w/cRJJrp UQUOelko6NUeWprePOo/lsrQgThY9+ZmsnAKZYZdESzh6ygi/rsR4G+/Znx6jjtT8aJ/ ZjaQ== X-Gm-Message-State: AO0yUKU/9W1Kv4mnQjknhJMu6U0Tck7JqZDuEcVt2QCuwJpgryNrspFB 8m8nsc32Ae4TOnNVtm/DmvPcLhVY358oVql1fso= X-Google-Smtp-Source: AK7set9QGw9HG5/crQXdPjveTHJ8yKivA2+a3F/LX1FAXptKEhR5ULnfENqcQz00Qx+X0uqRSmpM2JaQjWK9e6ahu2w= X-Received: by 2002:a62:cd83:0:b0:5e5:7675:88e3 with SMTP id o125-20020a62cd83000000b005e5767588e3mr6798556pfg.5.1678231890751; Tue, 07 Mar 2023 15:31:30 -0800 (PST) MIME-Version: 1.0 References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> In-Reply-To: <87bkl4y5gw.fsf@metapensiero.it> From: Rob Moss Date: Wed, 8 Mar 2023 10:31:19 +1100 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Mailman-Approved-At: Wed, 08 Mar 2023 10:38:37 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thank you both very much. This issue is a minor inconvenience, I've only encountered this in a single block of code. And I didn't realise that python-ts-mode reuses the python-mode indentation code, I had expected it would use tree-sitter instead. All the best, Rob On Wed, 8 Mar 2023 at 01:57, Lele Gaifax wrote: > > Thank you for the head up, I will try to understand the issue and > hopefully fix the problem as time permits. > > ciao, lele. > -- > nickname: Lele Gaifax | Dire che Emacs =C3=A8 "conveniente" =C3=A8 come > real: Emanuele Gaifas | etichettare l'ossigeno come "utile" > lele@etour.tn.it | -- Rens Troost From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Mar 2023 17:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lele Gaifax , 62031@debbugs.gnu.org Cc: Rob Moss Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.167829826612727 (code B ref 62031); Wed, 08 Mar 2023 17:58:01 +0000 Received: (at 62031) by debbugs.gnu.org; 8 Mar 2023 17:57:46 +0000 Received: from localhost ([127.0.0.1]:50157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZy2r-0003JC-N2 for submit@debbugs.gnu.org; Wed, 08 Mar 2023 12:57:46 -0500 Received: from mail-ed1-f44.google.com ([209.85.208.44]:35500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZy2q-0003It-3X for 62031@debbugs.gnu.org; Wed, 08 Mar 2023 12:57:44 -0500 Received: by mail-ed1-f44.google.com with SMTP id u9so69188586edd.2 for <62031@debbugs.gnu.org>; Wed, 08 Mar 2023 09:57:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678298258; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=s2llRNQ/S0HS6Jfc7QU7StYjfaCgLitUoaBZkQ2lfwM=; b=KDpAcxiKUmGbBl/8AtmhwvH3ePb23GpXxya/d85BDQkelsldZQcNJ/8tGqMTfAziGT VhxrmeM5cuRD+0xJ9zMDiCCAnVAnijn530Mgzob4Q3sLTwNXtdPcIQtlUD+HedrqiyTX F3OohMFP1fvAgby329Riv1v63I6EXlnPZaVtIbYzfB3P8m/9XWlGMTopY608Y9yKG0yp 14B9FXLIEKn8S8adn3ssTbR7xij+5viLE5kFDBYGIev8M1UGYrrOuaNg0vDaNDtOQodv bzMPnqfMnKy8aZzwhGWQU+aFT35v5LmWpnmtUN3UxJuA2kiYf4qrJhbF2wA39DrhAuuj L0hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678298258; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s2llRNQ/S0HS6Jfc7QU7StYjfaCgLitUoaBZkQ2lfwM=; b=pkv0arQkY4paEIeUkvE21UupgfdDI3fqEkVyl2btht0srFJk7UInwpGkDLK+FcbFG2 c+cLIHD6CXqfCTkFSP8sXDHML23/NBywXNpYr9kHvoCI6zPIzjyvBoRD5bzya5rLfuG4 oVHwNy4hSToXx2gTQh+idH+fW+wO2nf6Lt5qRbk1QdOD28eA6i84pijxqKEUV0gD/cnf J74Nr8HMpUKkHHJCkR7EEIwvVqPHhAU8RS0I0V2blPoBwzyLMEVo6D/ItBG/qwPdT08K irTDog3GnB8JtstyifguMNNpZuGPDWzGKeLxuQvwHZ9XwfQY62CMdAWswUGV9UXLEOO7 f1hA== X-Gm-Message-State: AO0yUKXymJpgHLSd3wJKT53HI6zmIFjczUYIAGL3r2IyfSX+SLj645lh K6wimGKZ5Jm37ldnEqlu3kk= X-Google-Smtp-Source: AK7set9x797WjicTR0T7ZRROz6YLEQVoYnm498Z7VcY8/zfHLEMLDrJfzSEqZUjLmtY7EsuI6yFGtQ== X-Received: by 2002:aa7:d6d8:0:b0:4a0:af87:b3ab with SMTP id x24-20020aa7d6d8000000b004a0af87b3abmr14981953edr.36.1678298258224; Wed, 08 Mar 2023 09:57:38 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id b31-20020a509f22000000b004eb16b75b93sm3648909edf.49.2023.03.08.09.57.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Mar 2023 09:57:37 -0800 (PST) Message-ID: <69793abf-3d2f-2dbe-698b-877ededfc56b@yandex.ru> Date: Wed, 8 Mar 2023 19:57:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> <87wn3rk7bk.fsf@metapensiero.it> From: Dmitry Gutov In-Reply-To: <87wn3rk7bk.fsf@metapensiero.it> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 08/03/2023 09:53, Lele Gaifax wrote: > I had a quick glance at this, and while I can confirm the problem with > the following test > > diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el > index 4f24c042c6a..9926c4b002f 100644 > --- a/test/lisp/progmodes/python-tests.el > +++ b/test/lisp/progmodes/python-tests.el > @@ -1982,6 +1982,17 @@ python-virt-bin > (should (eq (car (python-indent-context)) :after-block-start)) > (should (= (python-indent-calculate-indentation) 8)))) > > +(ert-deftest python-indent-after-re-match () > + "Test BUG 62031 regression." > + (python-tests-with-temp-buffer > + " > +def test_re(string): > + if re.match('^[a-c]+$', string): > + print('yes') > + else: > +" > + (python-tests-look-at "else:") > + (should (= (python-indent-calculate-indentation) 4)))) > > I could not figure out how this can be fixed, with my current knowledge > on python.el. > > There are several places where the regexp produced by `(python-rx > block-start)' is used, many within a `(looking-at ...)' form and several > others in a `(re-search-forward ...)': given that block starting > "keywords" are required to be at the beginning of a line, possibly > preceded by whitespace, I think that the problem may arise from those > usages which do not explicitly enforce the constraint, but unfortunately > all my attempts to do that a) didn't make the test above green and b) > broke one or more of the other tests. Right, the problem is that we need some post-check for block-start searches. python-rx (like rx in general) is just a syntax for Emacs regexp, and it doesn't support lookbehind or etc. After some edebug-ing, the patch below seems to fix this case. Maybe other uses of (python-rx block-start) need this treatment as well, but I'd like to leave that to someone who comes later. And a lot of them happen after a (back-to-indentation) call, so those seem covered too. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 1f970633bfc..aff8dc206b4 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5792,7 +5792,9 @@ python-info-dedenter-opening-block-positions (catch 'exit (while (python-nav--syntactically (lambda () - (re-search-backward (python-rx block-start) nil t)) + (cl-loop do (re-search-backward (python-rx block-start) nil t) + until (memq (char-before) '(nil ?\s ?\t ?\n)) + finally return (point))) #'<) (let ((indentation (current-indentation))) (when (and (not (memq indentation collected-indentations)) From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Lele Gaifax Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Mar 2023 18:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov , 62031@debbugs.gnu.org Cc: Rob Moss Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.167829903614009 (code B ref 62031); Wed, 08 Mar 2023 18:11:02 +0000 Received: (at 62031) by debbugs.gnu.org; 8 Mar 2023 18:10:36 +0000 Received: from localhost ([127.0.0.1]:50183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZyFI-0003dt-I3 for submit@debbugs.gnu.org; Wed, 08 Mar 2023 13:10:36 -0500 Received: from orphu.arstecnica.it ([178.63.97.204]:38774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZyFG-0003dj-Ao for 62031@debbugs.gnu.org; Wed, 08 Mar 2023 13:10:35 -0500 From: Lele Gaifax DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metapensiero.it; s=mail; t=1678299032; bh=IotxK5Kywv+em12ZS1XDPZ/E8ko9LiFtkRk/ZRAfmSk=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=HRMDu0oQaCXgWLOKH6+Nd+VUyK4FBXEYjga9eCJT/qaZKRYfTF9uhw0EH+Xhq8+cl VbDiM+nL2Ash3Vf+tspM68YGP097w1Dq5no38I8V94/frjgaBfEjjtoiHFMwEET8eL y0p5+ujJq6gfVgsa2ZKbrwjuy8qMLsvu9r1GBzzE= In-Reply-To: <69793abf-3d2f-2dbe-698b-877ededfc56b@yandex.ru> References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> <87wn3rk7bk.fsf@metapensiero.it> <69793abf-3d2f-2dbe-698b-877ededfc56b@yandex.ru> Date: Wed, 08 Mar 2023 19:10:25 +0100 Message-ID: <875ybb9kry.fsf@metapensiero.it> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > Right, the problem is that we need some post-check for block-start > searches. Thank you Dmitry! > After some edebug-ing, the patch below seems to fix this case. Are you going to commit that? bye, lele. From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Mar 2023 18:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lele Gaifax , 62031@debbugs.gnu.org Cc: Rob Moss Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.167829931314484 (code B ref 62031); Wed, 08 Mar 2023 18:16:01 +0000 Received: (at 62031) by debbugs.gnu.org; 8 Mar 2023 18:15:13 +0000 Received: from localhost ([127.0.0.1]:50195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZyJl-0003lY-F9 for submit@debbugs.gnu.org; Wed, 08 Mar 2023 13:15:13 -0500 Received: from mail-ed1-f41.google.com ([209.85.208.41]:42872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZyJj-0003lI-AE for 62031@debbugs.gnu.org; Wed, 08 Mar 2023 13:15:11 -0500 Received: by mail-ed1-f41.google.com with SMTP id o12so69217505edb.9 for <62031@debbugs.gnu.org>; Wed, 08 Mar 2023 10:15:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678299305; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=NEdEeZELmlW5pu4Rqj6AM4mq5SphObaBkCPduzxuLXg=; b=E5IqflYkUuPjwdiCeTNkgw0v4PeBCH777v1dGZGYGCVqMFlPCiQN5KXqltEkdTmvLL axqrMyUI83Ic9Mo7vEkRZI1V+IZkw8upY7wAeQ3oNggOa23VuTnUqOpPeXlo559C8k9w Fmi6JXSwKYrmCnCJl3gIChNtfykqSOJ3qBlfkin61Qf1/gTVImMKYQxlIJRmwp6KiUXq Pkhm47cbBsdEAQRIZ+NLztAPXt4fDpOO4JG+cd2obWLqkFeCzKj60RXZvQN1I+Tv0BBC gV6/T+5e3o6NjwzEpCmztawKGYTFZXnCniltYzpJppjRUTbp+5vKO/mnLum0JlXv2ENP zFdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678299305; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NEdEeZELmlW5pu4Rqj6AM4mq5SphObaBkCPduzxuLXg=; b=U9APP1mlrNXyV9TrZCaO60VyoD52a+V3pSDZblcueSrlWLvp/jR6t8XOEL1o/g4Uge Ha1kd69ov9O1H79EOj0erhIUE8UcirD7JDYr70RUlNmaC5ybhIWnTrwnUCIzhEvBEafG VJkDZ0ErvqfX5bt479kJ/R6SF413h+gt7iKk9cNvlcwMOKQn4q4o8ve/y+Nqrtax+2pp kyTyjIXOzPXzDN6RAPttDkeYjd/5TFtl19aqtgjGl/giKyoFnMW0Iconmlq5xubHj5D+ 9OsEJfKWWFJzQ9620vgIRr0BuRTTWUCvOFli0V7zsiuqfK+DZmEeWgPa39RHeQAGcx31 m+Rg== X-Gm-Message-State: AO0yUKXL38FFnvPmO4Z72tGd5hS/0MRZEeSce/Tjv7iVLYNtrGUmeTgi tjYwoZpqFHmZhkbG9/uqcEE= X-Google-Smtp-Source: AK7set+k0oUuWKk5DwHsWNyodosBURrKQa9eZmkZfBM3fn4tt+583qz1dfFcssYrXDnCQfqme83tWA== X-Received: by 2002:a17:906:5e0c:b0:872:82d3:4162 with SMTP id n12-20020a1709065e0c00b0087282d34162mr17413568eju.44.1678299304856; Wed, 08 Mar 2023 10:15:04 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id o6-20020a17090611c600b008b17eb06282sm7790956eja.213.2023.03.08.10.15.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Mar 2023 10:15:04 -0800 (PST) Message-ID: Date: Wed, 8 Mar 2023 20:15:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US From: Dmitry Gutov References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> <87wn3rk7bk.fsf@metapensiero.it> <69793abf-3d2f-2dbe-698b-877ededfc56b@yandex.ru> In-Reply-To: <69793abf-3d2f-2dbe-698b-877ededfc56b@yandex.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 08/03/2023 19:57, Dmitry Gutov wrote: > After some edebug-ing, the patch below seems to fix this case Small correction for cases outside of any blocks: diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 1f970633bfc..81475f31f60 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5792,7 +5792,9 @@ python-info-dedenter-opening-block-positions (catch 'exit (while (python-nav--syntactically (lambda () - (re-search-backward (python-rx block-start) nil t)) + (cl-loop for pt = (re-search-backward (python-rx block-start) nil t) + until (memq (char-before) '(nil ?\s ?\t ?\n)) + finally return pt)) #'<) (let ((indentation (current-indentation))) (when (and (not (memq indentation collected-indentations)) From unknown Tue Aug 19 05:28:55 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Rob Moss Subject: bug#62031: closed (Re: bug#62031: 29.0.60; python-mode indentation after re.match) Message-ID: References: X-Gnu-PR-Message: they-closed 62031 X-Gnu-PR-Package: emacs Reply-To: 62031@debbugs.gnu.org Date: Wed, 08 Mar 2023 20:53:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1678308782-16802-1" This is a multi-part message in MIME format... ------------=_1678308782-16802-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #62031: 29.0.60; python-mode indentation after re.match which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 62031@debbugs.gnu.org. --=20 62031: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D62031 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1678308782-16802-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 62031-done) by debbugs.gnu.org; 8 Mar 2023 20:52:16 +0000 Received: from localhost ([127.0.0.1]:50311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pa0lk-0004Ln-1Q for submit@debbugs.gnu.org; Wed, 08 Mar 2023 15:52:16 -0500 Received: from mail-wm1-f52.google.com ([209.85.128.52]:38743) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pa0lg-0004LY-4x for 62031-done@debbugs.gnu.org; Wed, 08 Mar 2023 15:52:14 -0500 Received: by mail-wm1-f52.google.com with SMTP id ay29-20020a05600c1e1d00b003e9f4c2b623so2207961wmb.3 for <62031-done@debbugs.gnu.org>; Wed, 08 Mar 2023 12:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678308726; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=brDy2C/UNLIc8beOCCjcGYc9t+3gdRPO7Yy3fdIrZIU=; b=jgwPbbJKO2G5P5d3YZZMtA+goD/8I8CQ8zFsooWSYg2lFU8Fz6R1pipPDv+Wc7N/Ht fOWvU33duVPhXlpDC5bAkZzEI1vwhZBbAtztTRwtEFECn5Q1Abs0Seu4/SwlZcz/9f+Y dI40GU7lL5Xg4FE+C9twJPwi3hBsvJGR6snsuqeHPNnuP+jJIgZUYRFYmMNustwCk8+R PZp2c6CLZ1Zm+JKpWC/iQD01FnOll8eiFqYQ8/tQnbdndVoSznS6UDy6tqJPnvCYhObE ThDjHitZy3d5YsU28oqvQprC0SakhSddMnXS9RQpyF7WPKeysG3e60Jl6zmPqDveQIP0 rB1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678308726; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=brDy2C/UNLIc8beOCCjcGYc9t+3gdRPO7Yy3fdIrZIU=; b=Z6V8SYIYnaLOxZL1GwowzhMVv+OXXDNwA1vxMfRiPtpQhULorSUGJYK0Zyi6EEVBK5 i3V8pnCU0ZN4Ttr0WRyVyigZ/s0iYzlu02oUNz8O30pzE2JUG7tn2sqWZb/uFkQU7JEe pPyA5jrrHaVGqav58EQaYpc4f4Fjqd/JEU7H3BDNqgiNXPnKHAtLuCW9VlJWGiSPc1Bl Wj2ULe8W8wlpm78g3pIovwjZ3SCUso5l7yZ/1Ccm+7RY5C/q+tLJ7ijPnGgyEW8mvFA9 zlSVyOP6RZPX8hzf+Hmp4u3imfzfA9o7tF89cArHFYGnXbdIIlD+MRKRYZA5+AkAXz1g 0t6Q== X-Gm-Message-State: AO0yUKWeN2KWjrn9xpqcc53CU6PDtV4YRDb2pQTPQv2M30FHFVSd7qH1 Ra0EmFRfNyl4I8kjCJRrPeM= X-Google-Smtp-Source: AK7set+m9X43rGMcM2bI+ZLWznHI2wEXfAwzPpn9so+jwskXgg+zdFtN2aGQGol4WywEIJoUBd8AKw== X-Received: by 2002:a05:600c:3592:b0:3eb:399d:ab1d with SMTP id p18-20020a05600c359200b003eb399dab1dmr17707993wmq.16.1678308726205; Wed, 08 Mar 2023 12:52:06 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id d9-20020a05600c3ac900b003dc522dd25esm478015wms.30.2023.03.08.12.52.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Mar 2023 12:52:05 -0800 (PST) Message-ID: Date: Wed, 8 Mar 2023 22:52:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: bug#62031: 29.0.60; python-mode indentation after re.match Content-Language: en-US To: Lele Gaifax , 62031-done@debbugs.gnu.org References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> <87wn3rk7bk.fsf@metapensiero.it> <69793abf-3d2f-2dbe-698b-877ededfc56b@yandex.ru> <875ybb9kry.fsf@metapensiero.it> From: Dmitry Gutov In-Reply-To: <875ybb9kry.fsf@metapensiero.it> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 62031-done Cc: Rob Moss X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 08/03/2023 20:10, Lele Gaifax wrote: > Are you going to commit that? With no further comments, I committed it with your test. Pushed to emacs-29, thanks all, and closing! ------------=_1678308782-16802-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 7 Mar 2023 08:54:35 +0000 Received: from localhost ([127.0.0.1]:44421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZT5d-00024o-M2 for submit@debbugs.gnu.org; Tue, 07 Mar 2023 03:54:35 -0500 Received: from lists.gnu.org ([209.51.188.17]:36136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZPCP-0003nR-Vj for submit@debbugs.gnu.org; Mon, 06 Mar 2023 23:45:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZPCH-00065R-82 for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 23:45:14 -0500 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZPCD-0007lc-6R for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 23:45:08 -0500 Received: by mail-pj1-x1042.google.com with SMTP id kb15so12078223pjb.1 for ; Mon, 06 Mar 2023 20:45:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678164303; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=hQVTGnu+NlNo1JirLUu4L1jG+wgReamixMe5yQe8f78=; b=e/H1SFjYsAWMjQt8LQIkP8JRPo3GGdvTV5UlY2WVDUx2D8okyeyLaI9YU9NrZxjA9d i3fX8b08FoLYYtLyutXs9y5TeAvT2KAAHTWn/30JjE8Vajyhj+Q+lkWdQwaQoQ7sZI/W TQsmu9X1dVKlHORpL+58TP7LoaYmHl/9JOgaeTZYBNSU3oI7w0ZKseWA5RJ7ihe8hZEQ afDH7IUe3FA2DIr1Njm5p0yI47rM/nCwWqtli0bHoWAwf2EdHaSoOj/w02bDUykMXUmz N37xnHZZz7S1EhIEDD4YfyGR1B76dijfkgtiybyRcwnKepleb13x8LKgzrJ4/Zxo6OVe aIfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678164303; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=hQVTGnu+NlNo1JirLUu4L1jG+wgReamixMe5yQe8f78=; b=zJtqJ8x9Un0r5VKd6vsKvU6Ze+Lr8dkfHOMcSKLkpeNxhzGZXE1mROYy7q8mns0YUf iDS7kJq+PCZy/h/fnL7K4+3Wz/5I8UxhIHRwQZY6n3yXh2n/0kVc2I7ulrutzQNJf594 lbrvxkG1NV4glR6UFQTp7Kr/GWFpQXSka2UQLy5ibGhlgWqPuV1nxeEXNEf8knsvXpzx q0+2J4cucf9XYLURqpLB0NU59TSOY7FQYVKSaJNEvo98RYCPtHTSWX74viiOvTTxR6Tj w0j4JNtbE48/vlvdzvbu1lKIt3mAFhba1WfbHxr3viWsOISYKt0ojpKu0o6gtLgPW+W4 LRFw== X-Gm-Message-State: AO0yUKVDmGMbwc++9XyCNMcq73aafTkEpaHZhzi2Um8Y6WcRgTRsGUbB IV9j7wsTPJ8cKAbSP/pZDaQuf3PzPvEfYLBYxBJkZXHv+qpnGJR4yW8= X-Google-Smtp-Source: AK7set8DWN8vHoN2DHpGybpUTX4CsvBvaFZ4TbylCi4D8rJw7pZK0pvEnDMQ1IHXrYZYJZnq7lBV4JxLFGgIQpaSLlg= X-Received: by 2002:a17:902:efce:b0:19b:5233:51d8 with SMTP id ja14-20020a170902efce00b0019b523351d8mr5400831plb.13.1678164302857; Mon, 06 Mar 2023 20:45:02 -0800 (PST) MIME-Version: 1.0 From: Rob Moss Date: Tue, 7 Mar 2023 15:44:51 +1100 Message-ID: Subject: 29.0.60; python-mode indentation after re.match To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::1042; envelope-from=robm.dev@gmail.com; helo=mail-pj1-x1042.google.com X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 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, LONGWORDS=2.035, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URI_HEX=0.1 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 07 Mar 2023 03:54:32 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi there, Starting from 'emacs -Q' I do the following: 1. Visit a new Python file ("~/test.py", say); 2. Enter the following lines: ---------------------------------------- import re def test_re(string): if re.match('^[a-c]+$', string): print('yes') else: print('no') ---------------------------------------- 3. Place the cursor on the "else:" line and press . This has the following effect on the buffer contents: ---------------------------------------- import re def test_re(string): if re.match('^[a-c]+$', string): print('yes') else: print('no') ---------------------------------------- Pressing repeatedly has no effect, this incorrect indentation is the only indentation it allows. I experience this issue with "python-mode" and "python-ts-mode", but if I change "re.match" to "re.matches", the correct indentation is preserved. So presumably the "match" in "re.match" is being treated as a match statement. All the best, Rob In GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2023-02-24 built on 5050l-202293-l.mobility.unimelb.net.au Repository revision: 94e70ed4261dbfcef679697dfa0dc2348a90dbdc Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: Ubuntu 20.04.5 LTS Configured using: 'configure --with-native-compilation --with-json --with-cairo --with-tree-sitter --with-sqlite3 --prefix=/opt/emacs29 CFLAGS=-O2' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_AU.UTF-8 locale-coding-system: utf-8-unix Major mode: Python Minor modes in effect: consult-org-roam-mode: t org-roam-db-autosync-mode: t flyspell-mode: t pdf-occur-global-minor-mode: t pyvenv-mode: t smartparens-global-mode: t smartparens-mode: t global-company-mode: t company-mode: t global-flycheck-mode: t flycheck-mode: t recentf-mode: t desktop-save-mode: t global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t global-diff-hl-mode: t diff-hl-mode: t vertico-multiform-mode: t vertico-mode: t savehist-mode: t marginalia-mode: t mood-line-mode: t which-key-mode: t global-hl-todo-mode: t hl-todo-mode: t olivetti-mode: t delete-selection-mode: t global-hl-line-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t context-menu-mode: t global-font-lock-mode: t font-lock-mode: t line-number-mode: t visual-line-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Features: (shadow mail-extr emacsbug cl-print rst shortdoc help-fns radix-tree pulse skeleton misearch multi-isearch latexenc oc-basic rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid nxml-mode nxml-outln nxml-rap sgml-mode facemenu make-mode cal-move ess-sp6-d tabify ucs-normalize org-roam-boxes consult-org-entity embark-org embark-consult embark consult-org consult-org-roam consult-org-roam-buffer f consult-vertico consult compat-28 org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id org-roam-node org-roam-db org-roam-utils org-roam-compat org-roam org-capture org-attach emacsql-sqlite url-http url-auth url-gw novice vertico-directory mule-util conf-mode sh-script smie cursor-sensor reftex-dcr reftex reftex-loaddefs reftex-vars tex-mode mixed-pitch adaptive-wrap reveal org-superstar ox-beamer ffap ol-eww eww url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo gnus-spec gnus-int gnus-range gnus-win gnus nnheader range ol-docview doc-view ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi outshine outshine-org-cmds outorg ox-jfm ox-gfm ox-md ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar org-agenda ox-html table ox-ascii ox-publish ox org-element org-persist xdg org-id org-refile avl-tree ob-shell ob-dot ob-R ob-python ob-haskell org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete org-list org-footnote org-faces org-entities ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs cal-menu calendar cal-loaddefs org-version org-compat org-macs eglot external-completion array jsonrpc ert debug backtrace python-blue python compat treesit init sanityinc-tomorrow-night-theme executable vc-git whitespace face-remap flyspell ispell sort gnutls nsm dns elpher pdf-occur ibuf-ext ibuffer ibuffer-loaddefs pdf-isearch let-alist pdf-misc pdf-tools pdf-view magit-bookmark bookmark jka-compr pdf-cache pdf-info tq pdf-util pdf-macs image-mode exif tablist tablist-filter semantic/wisent/comp semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet mastodon-alt mastodon-media url-cache mastodon-tl ts s mastodon shr pixel-fill kinsoku url-file svg dom mastodon-toot mastodon-iso persist mastodon-http request ffmpeg-elf yaml-mode emacsql-sqlite-builtin sqlite emacsql-sqlite-common emacsql emacsql-compiler xml bibtex rust-mode poly-R ess-r-mode ess-r-flymake flymake-proc flymake ess-r-xref ess-trns ess-r-package ess-r-completion ess-roxy ess-r-syntax ess-rd hideshow ess-s-lang ess-help ess-mode ess-inf ess-tracebug compile tramp tramp-loaddefs trampver tramp-integration tramp-compat parse-time iso8601 ls-lisp poly-noweb poly-markdown markdown-mode noutline outline polymode poly-lock polymode-base polymode-weave polymode-export polymode-compat polymode-methods polymode-core polymode-classes eieio-custom eieio-base ess lisp-mnt ess-utils ess-custom pyvenv eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util cus-edit pp cus-load files-x driverr smartparens thingatpt company-oddmuse company-keywords company-etags etags fileloop generator xref project company-gtags company-dabbrev-code company-dabbrev company-files company-capf company-cmake company-xcode company-clang company-semantic company-eclim company-template company-bbdb company flycheck find-func recentf tree-widget wid-edit desktop frameset magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff git-commit log-edit message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell pcomplete comint ansi-osc ring server ansi-color magit-mode transient format-spec magit-git magit-section magit-utils crm diff-hl vc-dir ewoc vc vc-dispatcher diff-mode vertico-multiform vertico savehist orderless marginalia edmacro kmacro emojify advice apropos tar-mode arc-mode archive-mode pcase ht dash mood-line undo-fu hercules which-key hl-todo color-theme-sanityinc-tomorrow color olivetti delsel hl-line comp comp-cstr warnings icons cl-extra help-mode use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core undo-fu-autoloads haskell-mode-autoloads consult-dir-autoloads python-blue-autoloads emacsql-sqlite-builtin-autoloads mastodon-autoloads persist-autoloads consult-org-entity-autoloads pdf-tools-autoloads orderless-autoloads consult-org-roam-autoloads which-key-autoloads olivetti-autoloads smartparens-autoloads rx flycheck-autoloads org-roam-autoloads emacsql-sqlite-autoloads emacsql-autoloads finder-inf color-theme-sanityinc-tomorrow-autoloads citar-embark-autoloads citar-autoloads citeproc-autoloads string-inflection-autoloads parsebib-autoloads queue-autoloads embark-consult-autoloads embark-autoloads marginalia-autoloads vertico-autoloads polymode-autoloads ess-autoloads consult-autoloads compat-autoloads ts-autoloads info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib early-init rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 1904084 978312) (symbols 48 62463 106) (strings 32 307966 100211) (string-bytes 1 10375851) (vectors 16 147394) (vector-slots 8 3144694 1170710) (floats 8 905 2495) (intervals 56 45653 40421) (buffers 984 67)) ------------=_1678308782-16802-1-- From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Mar 2023 22:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ruijie Yu , Lele Gaifax Cc: Rob Moss , 62031@debbugs.gnu.org Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.167831560628209 (code B ref 62031); Wed, 08 Mar 2023 22:47:02 +0000 Received: (at 62031) by debbugs.gnu.org; 8 Mar 2023 22:46:46 +0000 Received: from localhost ([127.0.0.1]:50368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pa2YY-0007Kv-HQ for submit@debbugs.gnu.org; Wed, 08 Mar 2023 17:46:46 -0500 Received: from mail-ed1-f46.google.com ([209.85.208.46]:34441) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pa2YW-0007Ki-Fo for 62031@debbugs.gnu.org; Wed, 08 Mar 2023 17:46:45 -0500 Received: by mail-ed1-f46.google.com with SMTP id g3so72050602eda.1 for <62031@debbugs.gnu.org>; Wed, 08 Mar 2023 14:46:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678315598; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=nbwfLodoL2w0/u1JlCuQeqEZck+Qsp1UA9dhl8bAuLc=; b=mMh9/P8wnlSaJ/uF2e1bm2foBwWfoNpwWgb6PcpeSjrs5eFKVUMZ65YpMqcfT0An3L JXUjgojxaOikvmnshRJ1vN94sYK1cXTWebLvFaHM6qi2PO8V3dM+ukpZXctF58rw1wlY wZOUIsWiMxuZtBxJwejZsV5NRthc0bYjQANL9wD+NkX6tagy+zpU37WC9HOZXyXaYj6R SUY57c0cor7l/z5/lwTtmcNbATpPDxcC9hoVziB1tT6pGG3XcRzlRoXLoJWX3+Oti8aZ 3HhlgiK1MPAuUDH2F8AifvFLlTz7VwtmD5XQ2vH2zcQf/cch3zElgLOh/x6lU0TRpwoT M0BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678315598; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nbwfLodoL2w0/u1JlCuQeqEZck+Qsp1UA9dhl8bAuLc=; b=urp1Vt9YP2KGG2qKJnmAvXX8199Wdsc5NOBYGjt3Ur3E6P+RdC8gl0Vglta+ehiEpv WHaEpjXpq4SG7ykLRETP23wuiAE7mBCG7ZgLrKjoKXT5cYthbJI4oZ4lNP6A864B+jN2 jGEGMgHD03CUyr7jIAxLyJF6fsOJMxpKtFL2asXYYR8pbXZp00DN/YvpGfR4b8La5iCe X9T10B/T1inZ1fMrsgYm1E8W1DaiUvm7bSTZ4guoYzOrSLbURucSr3iMBJPnN1NwuoyF 620oZ1h/3hp+v21kzo3MEB/BH/E9s69kVbl+xeijOKXR0uItFk4dMMFDeAh0JB/t7tks fC7Q== X-Gm-Message-State: AO0yUKVZ6HzuLjYdVgyfMWjnpFKwW8lOrvRudFHsSkLrae+A+4NUdsrB 4amz8qCTZljkZVxXpZrK42M= X-Google-Smtp-Source: AK7set+YbGoZvDNJKtpG8hoSMyqydJhPmz3pjx+soNI/Gtvk66Z2Rc1URYVtSemejYusk/z2vD28lQ== X-Received: by 2002:a17:907:3fa6:b0:877:a9d2:e5e9 with SMTP id hr38-20020a1709073fa600b00877a9d2e5e9mr24586991ejc.42.1678315598408; Wed, 08 Mar 2023 14:46:38 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id h3-20020a170906590300b008ddf3476c75sm8087107ejq.92.2023.03.08.14.46.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Mar 2023 14:46:37 -0800 (PST) Message-ID: Date: Thu, 9 Mar 2023 00:46:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> <87wn3rk7bk.fsf@metapensiero.it> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 08/03/2023 15:23, Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Lele Gaifax writes: > >> [...] >> + if re.match('^[a-c]+$', string): >> + print('yes') >> + else: >> [...] > I think you might want to add a variation to this test, like this: > > from re import match > if match(...): pass I think this would be testing some different part of the logic (forward statement navigation?). Anyway, if you see any problem with indentation (with that snippet or not), please report. From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Rob Moss Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Mar 2023 02:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov Cc: Ruijie Yu , Lele Gaifax , 62031@debbugs.gnu.org Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.167832911128199 (code B ref 62031); Thu, 09 Mar 2023 02:32:01 +0000 Received: (at 62031) by debbugs.gnu.org; 9 Mar 2023 02:31:51 +0000 Received: from localhost ([127.0.0.1]:50542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pa64N-0007Kk-6a for submit@debbugs.gnu.org; Wed, 08 Mar 2023 21:31:51 -0500 Received: from mail-pg1-f175.google.com ([209.85.215.175]:39519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pa64K-0007KR-Ck for 62031@debbugs.gnu.org; Wed, 08 Mar 2023 21:31:50 -0500 Received: by mail-pg1-f175.google.com with SMTP id h31so232242pgl.6 for <62031@debbugs.gnu.org>; Wed, 08 Mar 2023 18:31:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678329102; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0HhOarwBJrvUyO7d6645GC/wrcf+zJQco9jweg9kN/c=; b=HcEEBxPlQuvxaV837QhClpUgK20T0EGf3MxF5wH3NHnIg+HV6N+v8Ka23tkKbU5fGR hw6YPXWqiTV1Fl9uCMi+zUGqUG/jvitMm/bPBXVVwy+w+Z6wuysXc3ghvp13/2Au6/7h wxzeEE2IkGMs58nVkslPvf8Ff0YW+jNPbKMk5WsncHaHED8BoHSq8XTjyZrFvqfApnXY IsDCYjJ7Fm1H83KfgQz0gYpSfwUl2XrLL+zj/dptqCGthEinunbhIL9y1XTJYlPlUPhJ heW542wfRadoRlrNf9JK0hRpNoR3ALKi49YQuGTCc//i3NgWWBxtlxafaQwW0ik/LDQ2 WN7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678329102; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0HhOarwBJrvUyO7d6645GC/wrcf+zJQco9jweg9kN/c=; b=wm/iqaQqiYJovahjFAuKXKsk41e+J7STTxfMdc/4EUe1LobfL4ibOhrcIm60sbdH3R 0S6tLcC8ghwtb2rDDXArSm9aOBSOgTDiFXwitgZfq6zgOYPY0M+ihgpjc74DGQmjUEic ABLCqFBJ/iI/N8VhOOvcZS8gz3DLVvhdvRKQbzjSN2nh1Idy/7LVMtCRNG7pcaq3Q/QM nxU3O+jCNROgInBalazm4l/nvmb6q6z6Z7uFScPWYCbaf3/xamPwGMQqO53Z5T0lz0me t0rodp6tAYAYNjH+0advUN9FHwsIuFYktxLlXhphtEg2M67o70lquLTNjfpmLnjyzPrf mIBQ== X-Gm-Message-State: AO0yUKXvLG3UlJh9ra7Wg/w6CM760lvpUrHXgVRVxq6RCf/ZVe+23G2y DF8gCxq1A2csy/4KLM+h8m/sTpTHPqj+TUUXjASKTRjtAoU= X-Google-Smtp-Source: AK7set+G9A2p/7xepAI54AwHiRxFNlDIorPqvGflHiiaTiz9zMgUot9SMuEFqwVLCgnOSnlUL1DyxHt6mPxN4fHJUHI= X-Received: by 2002:a62:8348:0:b0:5ef:95c9:6a88 with SMTP id h69-20020a628348000000b005ef95c96a88mr8403295pfe.5.1678329102514; Wed, 08 Mar 2023 18:31:42 -0800 (PST) MIME-Version: 1.0 References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> <87wn3rk7bk.fsf@metapensiero.it> In-Reply-To: From: Rob Moss Date: Thu, 9 Mar 2023 13:31:31 +1100 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi everyone, Thank you very much for fixing this issue. I've built Emacs 29 from this commit (34c1443) and the indentation is now correct. On Thu, 9 Mar 2023 at 09:46, Dmitry Gutov wrote: > > I think you might want to add a variation to this test, like this: > > > > from re import match > > if match(...): pass > > I think this would be testing some different part of the logic (forward > statement navigation?). > > Anyway, if you see any problem with indentation (with that snippet or > not), please report. Yes, the above example appears to depend on different logic, because the else statement is not correctly indented in this example (results shown after pressing ): from re import match def test_re(string): if match('^[a-c]+$', string): pass else: pass Should I file this as a new bug? Sincerely, Rob From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Ruijie Yu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Mar 2023 03:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov Cc: Rob Moss , Lele Gaifax , 62031-done@debbugs.gnu.org Received: via spool by 62031-done@debbugs.gnu.org id=D62031.167833143232613 (code D ref 62031); Thu, 09 Mar 2023 03:11:02 +0000 Received: (at 62031-done) by debbugs.gnu.org; 9 Mar 2023 03:10:32 +0000 Received: from localhost ([127.0.0.1]:50563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pa6fo-0008Tx-14 for submit@debbugs.gnu.org; Wed, 08 Mar 2023 22:10:32 -0500 Received: from netyu.xyz ([152.44.41.246]:51818 helo=mail.netyu.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pa6fm-0008Tm-AP for 62031-done@debbugs.gnu.org; Wed, 08 Mar 2023 22:10:30 -0500 Received: from fw.net.yu.netyu.xyz ( [222.248.4.98]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 99aebafa (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 9 Mar 2023 03:10:28 +0000 (UTC) References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> <87wn3rk7bk.fsf@metapensiero.it> <69793abf-3d2f-2dbe-698b-877ededfc56b@yandex.ru> <875ybb9kry.fsf@metapensiero.it> User-agent: mu4e 1.8.14; emacs 30.0.50 From: Ruijie Yu Date: Thu, 09 Mar 2023 11:04:14 +0800 In-reply-to: Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Dmitry Gutov writes: > On 08/03/2023 20:10, Lele Gaifax wrote: >> Are you going to commit that? > > With no further comments, I committed it with your test. > > Pushed to emacs-29, thanks all, and closing! Hi Dmitry, As I mentioned in the other subthread, there is a variation to this issue that remains unfixed. The following test case, a slightly modified version of the test case in your commit, has failed (tested on 7e1012765c40): --8<---------------cut here---------------start------------->8--- (ert-deftest python-indent-after-bare-match () (python-tests-with-temp-buffer " from re import match def test_re(string): if match('^[a-c]+$', string): print('yes') else: " (python-tests-look-at "else:") (should (= (python-indent-calculate-indentation) 4)))) --8<---------------cut here---------------end--------------->8--- Does it belong to this bug report? Or should I file a new bug instead? -- Best, RY From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Mar 2023 15:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ruijie Yu Cc: Rob Moss , Lele Gaifax , 62031@debbugs.gnu.org, Dmitry Gutov Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.167837576319531 (code B ref 62031); Thu, 09 Mar 2023 15:30:02 +0000 Received: (at 62031) by debbugs.gnu.org; 9 Mar 2023 15:29:23 +0000 Received: from localhost ([127.0.0.1]:52888 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paICp-00054x-B9 for submit@debbugs.gnu.org; Thu, 09 Mar 2023 10:29:23 -0500 Received: from mail-pl1-f179.google.com ([209.85.214.179]:38414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paICn-00054h-Me for 62031@debbugs.gnu.org; Thu, 09 Mar 2023 10:29:22 -0500 Received: by mail-pl1-f179.google.com with SMTP id n6so2373117plf.5 for <62031@debbugs.gnu.org>; Thu, 09 Mar 2023 07:29:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678375755; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=6cDLBQBX7PH5xALRQrq/Nczn/Q0eAWf+Z2WkF895zDM=; b=eZ2OoVY4GOuy/HLNai4Gzi6CZMw0cQUd3jsqKPGfe4dsGhz1mMXYMGHkiPQyfYHDW+ QanHc3vM/+/EihGZ9vuBaMQ2MFrqo7XZUGD/NuKKqnI0jUYUxwW50jVm1Cd1NwR+NzDX pMVdU3FcDxXBcSahq4upiQlV3/gIETaDfhb6f2haUCQqwFv+7hu+N5vtGqegfsbYp59k 7EU8aaZLD7E+lY5az//4doDtvZ7J1YleMSc1Z/JoDFy/3tiA6CfcCUjLZxe9TgabzHbz pzs6HspAy89PCgIj3YJHZDwQwNtHzDbSn6O+NA9qQRdCMWP4IuuKQ2d1WbBIJPWIMje1 Bilg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678375755; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6cDLBQBX7PH5xALRQrq/Nczn/Q0eAWf+Z2WkF895zDM=; b=6Yhcpbdl2Rv4OGLcDj55rLXCCqHpi2ZQrlp+vKgi/6wZujQT38z0Cw/zBG939aSxV3 HUFMpaD/nawT8XjqkGbebp1NB0BJPi/ztpTIwt7sdG1YFniAGi/cM12VKVAARkhjF7Pn JtS5v4o4EtiszrEFvVrPJKngbhyghIUw7Kvx5BxZz6g5SF4zbb/FgR3BkgDfjWbtBvOT JHIGAVkEZOE0rL/S2ITFOQHaNQ05NQY8LQ2zHG5o8mfSdRcQ2H4paua8n3HNV40H7pLk TLX+y3LE/VUUBDX5PJ2Y08GtMzEpXEYyJorB9EZ+HO3RTjF0Wm5dXkgFAnATUZIgAA7f oqBA== X-Gm-Message-State: AO0yUKWwyjWot12x/w8YbVHKsDlXvYWguyuDk4vGyyCRbIN0AJrbOpWF uzZ9GE5Ng8smk8tJlCBT7eQ= X-Google-Smtp-Source: AK7set9b3uoI4XIXp3QWr+hwEw1WjETZ19fnAZbmhThx2P7zi3p0vSJ5Kdr9ZDwlEvENqaFvEM9+ug== X-Received: by 2002:a17:90b:1bc9:b0:237:9c41:e0a4 with SMTP id oa9-20020a17090b1bc900b002379c41e0a4mr25022207pjb.17.1678375755602; Thu, 09 Mar 2023 07:29:15 -0800 (PST) Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id mg23-20020a17090b371700b00230cbb4b6e8sm78732pjb.24.2023.03.09.07.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 07:29:14 -0800 (PST) Date: Fri, 10 Mar 2023 00:29:11 +0900 Message-ID: From: kobarity In-Reply-To: References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> <87wn3rk7bk.fsf@metapensiero.it> <69793abf-3d2f-2dbe-698b-877ededfc56b@yandex.ru> <875ybb9kry.fsf@metapensiero.it> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/mixed; boundary="Multipart_Fri_Mar_10_00:29:11_2023-1" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Multipart_Fri_Mar_10_00:29:11_2023-1 Content-Type: text/plain; charset=US-ASCII Ruijie Yu wrote: > As I mentioned in the other subthread, there is a variation to this > issue that remains unfixed. The following test case, a slightly > modified version of the test case in your commit, has failed (tested on > 7e1012765c40): I think it's better to check the block-start is located at the beginning of the line. Attached is a patch which can pass the test case. --Multipart_Fri_Mar_10_00:29:11_2023-1 Content-Type: application/octet-stream; type=patch; name="0001-Don-t-misindent-else-after-if-match-in-Python.patch" Content-Disposition: attachment; filename="0001-Don-t-misindent-else-after-if-match-in-Python.patch" Content-Transfer-Encoding: 7bit >From 9d9f0d9af22f033a3471fd87f9e72d874bbb8b51 Mon Sep 17 00:00:00 2001 From: kobarity Date: Fri, 10 Mar 2023 00:08:41 +0900 Subject: [PATCH] Don't misindent 'else:' after 'if match:' in Python * lisp/progmodes/python.el (python-info-dedenter-opening-block-positions): Check that the block start is at the beginning of the line (Bug#62031). * test/lisp/progmodes/python-tests.el (python-indent-after-bare-match): New test. Co-authored-by: Ruijie Yu --- lisp/progmodes/python.el | 7 +++---- test/lisp/progmodes/python-tests.el | 12 ++++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 630250c15c3..136bf6a81db 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5792,12 +5792,11 @@ python-info-dedenter-opening-block-positions (catch 'exit (while (python-nav--syntactically (lambda () - (cl-loop while (re-search-backward (python-rx block-start) nil t) - if (memq (char-before) '(nil ?\s ?\t ?\n)) - return t)) + (re-search-backward (python-rx block-start) nil t)) #'<) (let ((indentation (current-indentation))) - (when (and (not (memq indentation collected-indentations)) + (when (and (= indentation (- (point) (line-beginning-position))) + (not (memq indentation collected-indentations)) (or (not collected-indentations) (< indentation (apply #'min collected-indentations))) diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 6928e313dc4..4461921f142 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -1994,6 +1994,18 @@ python-indent-after-re-match (python-tests-look-at "else:") (should (= (python-indent-calculate-indentation) 4)))) +(ert-deftest python-indent-after-bare-match () + (python-tests-with-temp-buffer + " +from re import match +def test_re(string): + if match('^[a-c]+$', string): + print('yes') + else: + " + (python-tests-look-at "else:") + (should (= (python-indent-calculate-indentation) 4)))) + ;;; Filling -- 2.34.1 --Multipart_Fri_Mar_10_00:29:11_2023-1-- From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Mar 2023 15:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ruijie Yu Cc: Rob Moss , Lele Gaifax , 62031-done@debbugs.gnu.org Received: via spool by 62031-done@debbugs.gnu.org id=D62031.167837641920589 (code D ref 62031); Thu, 09 Mar 2023 15:41:02 +0000 Received: (at 62031-done) by debbugs.gnu.org; 9 Mar 2023 15:40:19 +0000 Received: from localhost ([127.0.0.1]:52894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paINP-0005M1-GE for submit@debbugs.gnu.org; Thu, 09 Mar 2023 10:40:19 -0500 Received: from mail-ed1-f43.google.com ([209.85.208.43]:47024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paINO-0005Lo-3S for 62031-done@debbugs.gnu.org; Thu, 09 Mar 2023 10:40:18 -0500 Received: by mail-ed1-f43.google.com with SMTP id k10so8579068edk.13 for <62031-done@debbugs.gnu.org>; Thu, 09 Mar 2023 07:40:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678376412; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=/FkH1zW9evtBf6T/b9gT1tdagCCDi6RPJuKUxYgSfEg=; b=bT3p5pERsocNa3qTKtVkLd58H/B9Or4QQoUUtWQsNnKQUrSlODjfFEd+nR3ErX8X97 YxaVYwi4Za/6PyEkf+Ek1fAonRabY47O9twuZYXCfkTFBPk6NXMiwyKPH6nMDo9VhIk0 lkt1tbv/5qzLuejvLnq3qMb1pMV6Ujay5cqpINsboSNaBdGDjJ4YCbGRvVbXcSqaPqQG 8GpOTbh4uD3sAKgg8FhyqZsXS2nladFrC+vzX7v+osahd+axwgJkcBbYeVu7EjT/HUGg Hcpna2TUAY3NlToeBsxcj6kayuLVLeP2jqg4i2Dmd+BzqzHV5lccx8Ygg229IpjpGJND lR3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678376412; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/FkH1zW9evtBf6T/b9gT1tdagCCDi6RPJuKUxYgSfEg=; b=FaZcd1FSqJGGmbsDLWuWbMxmdL5OOkwalVAlwiEkjdH8FBbUoQXQeX8X5rACcOXHva qN2wPNKpIoSsBNZ320P0ajrGllEs6C+Rm96+UjFv5Xq8XkgDeAsKV8P+uvWD5BaYZHvN +E5GuJZhFV4yf2MKqaoPv/pBnCHyUjRsynYtYPYWtKEHmlRuKrdGQsQpf6PiDfRMfJl7 5euB4fQsbadg1S0MqGrOOCzhalRigmW6Gol39Gw4NM1ZDwKtT7ecDI019uTdOX/pvd6F UTDKxmuhzhdIsx4okL2UKS0OIu4mEQHtKawTSYrPrzhTlGus4gVgKRxwg4gkgLLh0Sqh Fgcg== X-Gm-Message-State: AO0yUKX4+IKAkGQAHOB37X6TQBgnctqbpl5owFMXB5Y8JIwYGUHfxQKX o0qfjR1vluQzeFzccgUcYwc= X-Google-Smtp-Source: AK7set/kl/AR5ll34T1jbO4B0eFQ40pQHXrPxnDgWeugTnX0qoviSXRJhe2G0OC/XnoHz/I83Vi1KQ== X-Received: by 2002:a17:906:5fd3:b0:8a4:e2aa:6cd9 with SMTP id k19-20020a1709065fd300b008a4e2aa6cd9mr20005512ejv.19.1678376412050; Thu, 09 Mar 2023 07:40:12 -0800 (PST) Received: from [192.168.0.2] ([85.132.229.92]) by smtp.googlemail.com with ESMTPSA id j12-20020a1709062a0c00b008f14cb68ddbsm9029276eje.91.2023.03.09.07.40.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Mar 2023 07:40:11 -0800 (PST) Message-ID: <02aecc1b-8e69-3150-2f7d-72706d7db327@yandex.ru> Date: Thu, 9 Mar 2023 17:40:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> <87wn3rk7bk.fsf@metapensiero.it> <69793abf-3d2f-2dbe-698b-877ededfc56b@yandex.ru> <875ybb9kry.fsf@metapensiero.it> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 09/03/2023 05:04, Ruijie Yu wrote: > As I mentioned in the other subthread, there is a variation to this > issue that remains unfixed. The following test case, a slightly > modified version of the test case in your commit, has failed (tested on > 7e1012765c40): > > --8<---------------cut here---------------start------------->8--- > (ert-deftest python-indent-after-bare-match () > (python-tests-with-temp-buffer > " > from re import match > def test_re(string): > if match('^[a-c]+$', string): > print('yes') > else: > " > (python-tests-look-at "else:") > (should (= (python-indent-calculate-indentation) 4)))) > --8<---------------cut here---------------end--------------->8--- That you for clarification with the full example > Does it belong to this bug report? Or should I file a new bug instead? It's the same piece of logic, I've pushed a fix in 29228e24f20 that makes the check stricter. From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Mar 2023 15:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: kobarity , Ruijie Yu Cc: Rob Moss , Lele Gaifax , 62031@debbugs.gnu.org Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.167837656120836 (code B ref 62031); Thu, 09 Mar 2023 15:43:01 +0000 Received: (at 62031) by debbugs.gnu.org; 9 Mar 2023 15:42:41 +0000 Received: from localhost ([127.0.0.1]:52903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paIPh-0005Pz-Ad for submit@debbugs.gnu.org; Thu, 09 Mar 2023 10:42:41 -0500 Received: from mail-ed1-f51.google.com ([209.85.208.51]:46762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paIPf-0005Pl-B2 for 62031@debbugs.gnu.org; Thu, 09 Mar 2023 10:42:39 -0500 Received: by mail-ed1-f51.google.com with SMTP id k10so8609785edk.13 for <62031@debbugs.gnu.org>; Thu, 09 Mar 2023 07:42:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678376553; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=E2GSU/nhmoIpesR3fWPUKN5OnO+quayTGOKqKm9TAPY=; b=WsOUVHljRSFI9b06PBq3OAOZtcNGFA5454VXp7uPXPwv03wcmNaShmAHl3HUHFk80Y DqSXW95gKmc/feaMA4gQtLdEPVIGlWadHxovXwdn/oDs3brfwn8iPaQTuouUg1/AN6J0 oSJVWOmuy7vHcuTL7Dima199/dh/gfws8Dy2YLUvzh0UcQBuTLYtqeTUL8H3dQhE/mHe 0HZWzWoIQH3GPKpLhB+j+5NLaObaAbE01y8WSiuncPkoFS97TjRK6oecvk3eAIPgH4Pz KMjTYQIGtsy93SJHB2nyQRKJSy1tlzqd+Uj+2Pzw41sZ2M5hHx7LzRqNsxtxtE7D+6tK FwaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678376553; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=E2GSU/nhmoIpesR3fWPUKN5OnO+quayTGOKqKm9TAPY=; b=CPiYf/XqaDQ3TtOdvlkbu2Fj/s2rviBHYNtqfH90HYltUNjT8yxZqXi5ZPLaIddjUx mV+FMANY86lQXY8Zz/4PrwoL+bVVh//gDQfr2qXAWkxK/9qRrkpiKDQEje5YOdSPeX1s YD/3l8B0xtgd4BdlStf715vO00i+Y157siq6zpc41XE1okbr8SLqj9Nv0/aE5rI76p6w pLaRjLgrolH7HHLovpU7HYywvutLhY7Zr6J23RI9uueyLoYMFX+2JNJ3HAQ61cNnPr1f qr5goYnNUEKLyNJMuJKcM+ojMYa8pB1cLsFtRq6JixkL+za8L6pxLOD3bxAH9jql3YIO 9Saw== X-Gm-Message-State: AO0yUKUv6xoRF6XrHlIF5pajsMI7oBGlF9lzL5mApbkxKuaHj3OrnNDZ mbF19XKuA9toIZrjf70CsP77z0Mp14k= X-Google-Smtp-Source: AK7set8owhn41eUKMePm4O11vPV9Ukdh8wxter+niUvCPH4grepU9nBHNX6P6ACoVAcUygsQTqmZuQ== X-Received: by 2002:aa7:d305:0:b0:4c0:4912:2006 with SMTP id p5-20020aa7d305000000b004c049122006mr18261372edq.11.1678376553677; Thu, 09 Mar 2023 07:42:33 -0800 (PST) Received: from [192.168.0.2] ([85.132.229.92]) by smtp.googlemail.com with ESMTPSA id k22-20020a50ce56000000b004c07b11deb8sm9751525edj.64.2023.03.09.07.42.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Mar 2023 07:42:33 -0800 (PST) Message-ID: Date: Thu, 9 Mar 2023 17:42:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> <87wn3rk7bk.fsf@metapensiero.it> <69793abf-3d2f-2dbe-698b-877ededfc56b@yandex.ru> <875ybb9kry.fsf@metapensiero.it> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 09/03/2023 17:29, kobarity wrote: > Ruijie Yu wrote: >> As I mentioned in the other subthread, there is a variation to this >> issue that remains unfixed. The following test case, a slightly >> modified version of the test case in your commit, has failed (tested on >> 7e1012765c40): > I think it's better to check the block-start is located at the > beginning of the line. Attached is a patch which can pass the test > case. Thank you, I've pushed a different patch which checks for the same thing. This is consistent with the search in python-nav-forward-block, for example. So it seems correct. From unknown Tue Aug 19 05:28:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62031: 29.0.60; python-mode indentation after re.match Resent-From: Lele Gaifax Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Mar 2023 15:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: kobarity , Ruijie Yu Cc: Rob Moss , 62031@debbugs.gnu.org, Dmitry Gutov Received: via spool by 62031-submit@debbugs.gnu.org id=B62031.167837669321048 (code B ref 62031); Thu, 09 Mar 2023 15:45:01 +0000 Received: (at 62031) by debbugs.gnu.org; 9 Mar 2023 15:44:53 +0000 Received: from localhost ([127.0.0.1]:52907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paIRo-0005TQ-OA for submit@debbugs.gnu.org; Thu, 09 Mar 2023 10:44:52 -0500 Received: from orphu.arstecnica.it ([178.63.97.204]:53390) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paIRl-0005TE-TT for 62031@debbugs.gnu.org; Thu, 09 Mar 2023 10:44:50 -0500 From: Lele Gaifax DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metapensiero.it; s=mail; t=1678376686; bh=Ci88Q2uI4f+pR7C7s/09+CAdrroVgpnyA/MtLdedRDI=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=ZqiPbAY9XzvsRrkHldRpXSCohlwFWlmicJIi4SCxnQmmHSA47GkZsJY11ULmeVXbx bRrVFGM2P4blc7aiELMJwDQUYxLQdjYDornltvRYnTPyFiyMHT3ygeuU9yR1Z5yFD0 tLbf0MLAGHTnMHmh8Wug8SBJftOBE3H2bxYqL+T8= In-Reply-To: References: <5ea3a37a-4e43-4ede-9f96-7159f54272e8@yandex.ru> <87bkl4y5gw.fsf@metapensiero.it> <87wn3rk7bk.fsf@metapensiero.it> <69793abf-3d2f-2dbe-698b-877ededfc56b@yandex.ru> <875ybb9kry.fsf@metapensiero.it> Date: Thu, 09 Mar 2023 16:44:40 +0100 Message-ID: <874jquudxz.fsf@metapensiero.it> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) kobarity writes: > Ruijie Yu wrote: >> As I mentioned in the other subthread, there is a variation to this >> issue that remains unfixed. The following test case, a slightly >> modified version of the test case in your commit, has failed (tested on >> 7e1012765c40): > > I think it's better to check the block-start is located at the > beginning of the line. Attached is a patch which can pass the test > case. Yes, that's indeed what I initially tried to do, but in the wrong way (that is, attempting to over-complicate the regexp) :-) Thank you! bye, lele.