From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#59009: python mode indentation behavior fix Date: Sun, 06 Nov 2022 10:18:35 +0200 Message-ID: <83wn881oo4.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1592"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59009@debbugs.gnu.org To: Randomneo , kobarity Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 06 09:20:13 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1orat2-0000HY-RT for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Nov 2022 09:20:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orasx-0001Sx-Bc; Sun, 06 Nov 2022 03:20:07 -0500 Original-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 1orass-0001Sj-FL for bug-gnu-emacs@gnu.org; Sun, 06 Nov 2022 03:20:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1orass-0006Wq-77 for bug-gnu-emacs@gnu.org; Sun, 06 Nov 2022 03:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1orass-0002IC-2q for bug-gnu-emacs@gnu.org; Sun, 06 Nov 2022 03:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Nov 2022 08:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59009 X-GNU-PR-Package: emacs Original-Received: via spool by 59009-submit@debbugs.gnu.org id=B59009.16677227438738 (code B ref 59009); Sun, 06 Nov 2022 08:20:02 +0000 Original-Received: (at 59009) by debbugs.gnu.org; 6 Nov 2022 08:19:03 +0000 Original-Received: from localhost ([127.0.0.1]:58621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oraru-0002Gs-Je for submit@debbugs.gnu.org; Sun, 06 Nov 2022 03:19:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1orars-0002GM-FJ for 59009@debbugs.gnu.org; Sun, 06 Nov 2022 03:19:01 -0500 Original-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 1orarm-0006Rs-Kw; Sun, 06 Nov 2022 03:18:55 -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=iRaHIEPORtPh2f26SjaPhEh2LjNMgazQfNJYNCZu2IY=; b=opXaI5DtOkGM dnhJvh4KNmtkYwSbJccyBLJEmZOHopznRgmYenm/jlXd6fGiQ5yU7IILraX8cNnshUfNFCpJZ7Zfe RwhUpQ7cNfDE8foDXcdGPw0HloSqmV/8NnCN4CO9XtVowRcRVpxRETl0NXYUJffaaTg0PlLa5HSqJ 4wXNrHNky37QdBOghUrIkuoBx9iNMb0WKvD3TUU/FngL9mTVqz8mWzf3AYUf4Y0XXFOYbC/O2j/5s J9b343FcxDpQuBppLhECIVxnLx6HAst1KuWE5luo0kzR9DVlxa1gER7uwG+HGl/4SUxwgL0W88iTQ 6BS+DPFWsdKkiEiBxSw8Pw==; Original-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 1orarl-0002KX-Ng; Sun, 06 Nov 2022 03:18:54 -0500 In-Reply-To: (message from Randomneo on Thu, 3 Nov 2022 18:41:42 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:247192 Archived-At: > From: Randomneo > Date: Thu, 3 Nov 2022 18:41:42 +0300 > > This patch will fix this bug #42513. > Also problems with same behaviour with pair of statements when one of them is multiline with prantaces like > https://pastebin.com/Z1yFbMtp. > > with best regards Misiura Rostislav > > From 91b310d1412366340b6deeff65519e248d87a10f Mon Sep 17 00:00:00 2001 > From: Rostyslav Misiura > Date: Thu, 3 Nov 2022 18:27:38 +0300 > Subject: [PATCH] python.el: Opening block search fix > > --- > lisp/progmodes/python.el | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el > index cec0d54a44..3ca8e49f2b 100644 > --- a/lisp/progmodes/python.el > +++ b/lisp/progmodes/python.el > @@ -5373,16 +5373,16 @@ likely an invalid python file." > (apply #'min collected-indentations))) > ;; There must be no line with indentation > ;; smaller than `indentation' (except for > - ;; blank lines) between the found opening > - ;; block and the current line, otherwise it > - ;; is not an opening block. > + ;; blank lines and comments) between the found > + ;; opening block and the current line, > + ;; otherwise it is not an opening block. > (save-excursion > (forward-line) > (let ((no-back-indent t)) > (save-match-data > (while (and (< (point) cur-line) > (setq no-back-indent > - (or (> (current-indentation) indentation) > + (or (>= (current-indentation) indentation) > (python-info-current-line-empty-p) > (python-info-current-line-comment-p)))) > (forward-line))) > -- > 2.38.1 kobarity, any comments on this patch?