GNU bug report logs - #65870
30.0.50; Error in python-mode when try to delete a character in badly-indented code

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Daniel Lopez <daniel.lopez999@HIDDEN>; dated Mon, 11 Sep 2023 16:38:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 65870 <at> debbugs.gnu.org:


Received: (at 65870) by debbugs.gnu.org; 3 Jun 2024 12:10:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 03 08:10:21 2024
Received: from localhost ([127.0.0.1]:34565 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sE6W4-0002pA-Kp
	for submit <at> debbugs.gnu.org; Mon, 03 Jun 2024 08:10:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39518)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sE5rc-00010k-8S
 for 65870 <at> debbugs.gnu.org; Mon, 03 Jun 2024 07:28:43 -0400
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 <eliz@HIDDEN>)
 id 1sE5pD-0000DA-2k; Mon, 03 Jun 2024 07:26:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=595D4zEhzWUbJbAj0Rd0IJ6wMUV2d+ALm+PfljaRGuk=; b=RmepmbGYJ/F2NUDHZCsE
 9+0/XCM8xdN9Q5F9DbbrN+1TPVDKmXYms8j816jdfesaF/qvy1FHHEVHKli1iibSUKTdb0lDlLfM8
 cRGVUK6m9jTk9bO79tzUTT7ZvBt0w0da0F5UIyjOG2G2RnB2ktChYP0QJVmi+LpNvMFsHDiE04UB6
 eOVrpqyeBvefJblQgZcjrLxLHfQEtbLG7S/NJ/gfYV6TSaSzmy6zhwNJgeRBnSbRqOC7qUlNk1h8f
 ZbQ9TN7u/K21yknucp0LtCRyMHqrhuQexb2e5pfBqBUEdhvMl0whErCdRnQB5GSkstk+b9F9UJaUT
 QE/Xb5DJQwRwXA==;
Date: Mon, 03 Jun 2024 14:25:57 +0300
Message-Id: <867cf6mfne.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jakub =?utf-8?B?SmXEjW3DrW5law==?= <kuba@HIDDEN>
In-Reply-To: <87jzj7xdbo.fsf@HIDDEN> (message from Jakub
 =?utf-8?B?SmXEjW3DrW5law==?= on Sun, 02 Jun 2024 21:08:30 +0000)
Subject: Re: bug#65870: 30.0.50;
 Error in python-mode when try to delete a character in badly-indented
 code
References: <87jzj7xdbo.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65870
Cc: kobarity@HIDDEN, daniel.lopez999@HIDDEN, 65870 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

> Date: Sun, 02 Jun 2024 21:08:30 +0000
> From: Jakub Ječmínek <kuba@HIDDEN>
> Cc: kobarity <kobarity@HIDDEN>, Daniel Lopez <daniel.lopez999@HIDDEN>, 65870 <at> debbugs.gnu.org
> 
> kobarity <kobarity@HIDDEN> writes:
> 
> Eli, can you please install this?  I can still reproduce the original error.

I'm waiting for other people to chime in if they want.  Please be
patient.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#65870; Package emacs. Full text available.

Message received at 65870 <at> debbugs.gnu.org:


Received: (at 65870) by debbugs.gnu.org; 2 Jun 2024 21:08:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 02 17:08:57 2024
Received: from localhost ([127.0.0.1]:40236 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sDsRl-0004xq-D7
	for submit <at> debbugs.gnu.org; Sun, 02 Jun 2024 17:08:57 -0400
Received: from mail-4317.proton.ch ([185.70.43.17]:54631)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kuba@HIDDEN>) id 1sDsRj-0004xP-2X
 for 65870 <at> debbugs.gnu.org; Sun, 02 Jun 2024 17:08:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kubajecminek.cz;
 s=protonmail; t=1717362515; x=1717621715;
 bh=gNu/UM4tJw5qVrCcHM2qNscLf5TWujyBeR/hWki5ng4=;
 h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date:
 Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector;
 b=FZsagQKr/h9/7X+GasOCP0KtHVdEJb0pr5U10CaN11Ch+a5/n8L0WborWm5JMALhs
 yprUCaE25fNtwvF1kUJdokYSDd+VdOJawTYM7wrjwHl0cmMF60zR3XWUOvyAF0Qymq
 4dUcRqx+f5RUuJ+pZp81nd/HsTEmSntmWVXuKrqVMxu0ssfPguRa8xOJKhHCZDe5A6
 EuQRpuvzRTxgMRn+as3LIL6RCu4DNgIh0N6OZGtKCIpy3YSaFj+tmuWOKUHEKjs/k7
 /5Ye2TURSmAWSWwHj6PVdZmjEHIBQygytukDumT+D66UUqX8VpvEzPRYUsjTsrVEjh
 VN+7i4NNIqXDw==
Date: Sun, 02 Jun 2024 21:08:30 +0000
To: Eli Zaretskii <eliz@HIDDEN>
From: =?utf-8?Q?Jakub_Je=C4=8Dm=C3=ADnek?= <kuba@HIDDEN>
Subject: Re: bug#65870: 30.0.50;
 Error in python-mode when try to delete a character in badly-indented
 code
Message-ID: <87jzj7xdbo.fsf@HIDDEN>
Feedback-ID: 98803324:user:proton
X-Pm-Message-ID: 7158ae6980521ed208c4552f40df23737fbf99f8
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 65870
Cc: kobarity <kobarity@HIDDEN>, Daniel Lopez <daniel.lopez999@HIDDEN>,
 65870 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

kobarity <kobarity@HIDDEN> writes:

> Eli Zaretskii wrote:
>> kobarity, any suggestions or comments?
>
> Thank you for the report.  The attached is the proposed fix.
>
>>From 32f0dbe5f942ffa60f0945d2ffb771db82db5832 Mon Sep 17 00:00:00 2001
> From: kobarity <kobarity@HIDDEN>
> Date: Sat, 16 Sep 2023 23:14:45 +0900
> Subject: [PATCH] Fix Python mode error caused by incorrect indentation
>
> * lisp/progmodes/python.el (python-indent--calculate-indentation):
> Guard against negative indentation.  (Bug #65870)
>
> * test/lisp/progmodes/python-tests.el
> (python-indent-badly-indented-block-end): New test.
> ---
>  lisp/progmodes/python.el            | 2 +-
>  test/lisp/progmodes/python-tests.el | 9 +++++++++
>  2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> index 4b940b3f13b..d7e49e225d8 100644
> --- a/lisp/progmodes/python.el
> +++ b/lisp/progmodes/python.el
> @@ -1660,7 +1660,7 @@ python-indent--calculate-indentation
>          (`(:after-block-end . ,start)
>           ;; Subtract one indentation level.
>           (goto-char start)
> -         (- (current-indentation) python-indent-offset))
> +         (max 0 (- (current-indentation) python-indent-offset)))
>          (`(:at-dedenter-block-start . ,_)
>           ;; List all possible indentation levels from opening blocks.
>           (let ((opening-block-start-points
> diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/py=
thon-tests.el
> index a44a11896f0..f3456030975 100644
> --- a/test/lisp/progmodes/python-tests.el
> +++ b/test/lisp/progmodes/python-tests.el
> @@ -2081,6 +2081,15 @@ python-indent-after-bare-match
>     (python-tests-look-at "else:")
>     (should (=3D (python-indent-calculate-indentation) 4))))
> =20
> +(ert-deftest python-indent-badly-indented-block-end ()
> +  "Test BUG 65870 regression."
> +  (python-tests-with-temp-buffer
> +   "
> +return
> +"
> +   (goto-char (point-max))
> +   (should (=3D (python-indent-calculate-indentation) 0))))
> +
>  =0C
>  ;;; Filling

Eli, can you please install this?  I can still reproduce the original error=
.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#65870; Package emacs. Full text available.

Message received at 65870 <at> debbugs.gnu.org:


Received: (at 65870) by debbugs.gnu.org; 17 Sep 2023 04:06:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 17 00:06:50 2023
Received: from localhost ([127.0.0.1]:48842 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qhj3Z-00024n-Op
	for submit <at> debbugs.gnu.org; Sun, 17 Sep 2023 00:06:50 -0400
Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:51516)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <daniel.lopez999@HIDDEN>) id 1qhj3W-00024X-Gg
 for 65870 <at> debbugs.gnu.org; Sun, 17 Sep 2023 00:06:48 -0400
Received: by mail-wm1-x32b.google.com with SMTP id
 5b1f17b1804b1-403012f27e3so39091085e9.3
 for <65870 <at> debbugs.gnu.org>; Sat, 16 Sep 2023 21:06:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1694923593; x=1695528393; darn=debbugs.gnu.org;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :from:to:cc:subject:date:message-id:reply-to;
 bh=f3Mby2YFMJmDKaXkTq3u4fr7WaGh10Oz7qF5BV4kmaw=;
 b=aq3pmePTLV59KVelY27SVEMSnuLHe8rhYAjD1+GjHpAzkLvVIRUfceY+/4tUNjL5wP
 OArtlDT/PJ39JoBLB77CrZ1xA68rBOeeeXdJZAQeLdv4TZoVbbJPeNm+6+E4Wy99tWH4
 KI99J8km9WLvEy55cPTXZ/6+XJYxAym0RCChUPHwM221/e8whOkkQhDyxL5RVzp0Rs86
 Op79BI66TZx3z9dr5G4nvZPCQWRiP2FJie5PCNUlUwsXqzskETMY6QQRUfHrGGBqaSIz
 vbC2o+ZXlZ2LM2CrNPckNDLAsHTjI2+j88v3l1GNm2QcdUQFELmGUA1+DaWxeow+Mn6N
 bWQA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1694923593; x=1695528393;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=f3Mby2YFMJmDKaXkTq3u4fr7WaGh10Oz7qF5BV4kmaw=;
 b=uz0d/3PCmJW3fp5oDRwCKSJXOYdy4SNNaUCWK8KnDACrt7UBs3O3r+8EUFwoOXxsDd
 fYTJzwk6N17u+X8kmf2k05Jg8Yc7mG0m0gDIdz49c1TRTDCPbzphP8FzdWa7FZk06c4p
 56nIm5NoqQXA6+cdn6y5ykdvdsI9aWeiwMtxZzE43IfGid6LfzLFBa7tM3rpjGCHHrrP
 I3o0yNuR1j+AVu5DLZMWTwXsW5kKOUTXNITzEeI2mE4OrVKyavEYZ+UID19zLwamWaQC
 zw5WsqkaJ/56xffzmxFOqkHM5p21rr9m1LEhrns1UetvDMkWFowWtgl3SYA2XC2GptmS
 crjw==
X-Gm-Message-State: AOJu0YxvofzK3SlM4Jg1Q+gImbsiiZgd4e3icIlJqsO7ipoLqNQaUIgx
 DDZGcyzLxHr4kfikLQV0EVU=
X-Google-Smtp-Source: AGHT+IGxofgfeY/lE7NXLnT+hyOCyW6DbnJd0uNuude44v8ZLKu5aiM1joaWQfT8wC5KH+1hIRSmSw==
X-Received: by 2002:a1c:4b0f:0:b0:401:4542:5edd with SMTP id
 y15-20020a1c4b0f000000b0040145425eddmr4906612wma.34.1694923592940; 
 Sat, 16 Sep 2023 21:06:32 -0700 (PDT)
Received: from [192.168.2.2] (w-113.cust-u7457.ip.static.uno.uk.net.
 [212.105.168.113]) by smtp.googlemail.com with ESMTPSA id
 c3-20020a05600c0ac300b003fef6881350sm8778297wmr.25.2023.09.16.21.06.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 16 Sep 2023 21:06:32 -0700 (PDT)
Message-ID: <da556700-20ce-4d81-a5e3-88de06e9f763@HIDDEN>
Date: Sun, 17 Sep 2023 05:06:10 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#65870: 30.0.50; Error in python-mode when try to delete a
 character in badly-indented code
Content-Language: en-US-large
To: kobarity <kobarity@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <3a4467d3-f190-4115-b73a-9ae18b31a527@HIDDEN>
 <83led6igai.fsf@HIDDEN> <eke7msxmxilp.wl-kobarity@HIDDEN>
From: Daniel Lopez <daniel.lopez999@HIDDEN>
In-Reply-To: <eke7msxmxilp.wl-kobarity@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 65870
Cc: 65870 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

On 16/09/2023 16:06, kobarity wrote:
> 
> Eli Zaretskii wrote:
>>> Date: Mon, 11 Sep 2023 17:36:59 +0100
>>> From: Daniel Lopez <daniel.lopez999@HIDDEN>
>>>
>>> To reproduce from emacs -Q:
>>>    C-x b hello.py RET
>>>    M-x python-mode
>>>    On the first line, type the word "return", then press the Return key.
>>>    On the second line, type one or more spaces.
>>>    Press Backspace. This triggers the error message:
>>>        python-indent-line: Wrong type argument: wholenump, -4
>>>    and, the last-typed space is not deleted.
>>>
>>> Backtrace of the error:
>>>    Debugger entered--Lisp error: (wrong-type-argument wholenump -4)
>>>      indent-line-to(-4)
>>>      python-indent-line(t)
>>>      python-indent-dedent-line()
>>>      python-indent-dedent-line-backspace(1)
>>>      funcall-interactively(python-indent-dedent-line-backspace 1)
>>>      command-execute(python-indent-dedent-line-backspace)
>>>
>>> This can also happen with Python keywords/statements that tend to end a
>>> scope, eg. "break" or "raise", as well as "return".
>>>
>>> I guess the smart dedenting sees the "return" (or similar statement) at
>>> top-level scope and then tries to move the cursor to a parent scope /
>>> negative column that doesn't exist. Perhaps one of those indent
>>> functions could clamp itself somehow to not do that but I'm not sure
>>> where the best place for that would be.
>>
>> Thanks.
>>
>> kobarity, any suggestions or comments?
> 
> Thank you for the report.  The attached is the proposed fix.

On applying the fix to my own installation, I can confirm that it works 
for me. Thanks. :)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#65870; Package emacs. Full text available.

Message received at 65870 <at> debbugs.gnu.org:


Received: (at 65870) by debbugs.gnu.org; 16 Sep 2023 15:07:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 16 11:07:20 2023
Received: from localhost ([127.0.0.1]:48268 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qhWtD-0000cm-Nc
	for submit <at> debbugs.gnu.org; Sat, 16 Sep 2023 11:07:20 -0400
Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:57596)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kobarity@HIDDEN>) id 1qhWtB-0000c7-3B
 for 65870 <at> debbugs.gnu.org; Sat, 16 Sep 2023 11:07:18 -0400
Received: by mail-pf1-x42d.google.com with SMTP id
 d2e1a72fcca58-68fb2e9ebcdso2500793b3a.2
 for <65870 <at> debbugs.gnu.org>; Sat, 16 Sep 2023 08:07:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1694876824; x=1695481624; darn=debbugs.gnu.org;
 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=ETaO6hpcXFCrQDM3NasLz6yvQ+2G9nioPAwVPX0ELJQ=;
 b=atavX7EgBlll1iahJFOi0Y/ofPwKYkM9srsxlsYvgQVTEhZT4eWv8oITiFXXcKYpz9
 8sajKC+1GmCnl74NWfyglzRPq/gCM+G2cefQofRRXfLYHKKfzZFavyYrAoLQWRFpJZ0k
 2FKkAGjZVM8lcLelNS2SbAPctXL+uRYLq+sFkxFsJTWtjg2rWGGUkQDr5WT83c7Ln5IY
 PS0DX9khXr+xf4BMY1hakt54ApSMTbRtDidFVCPwS7L9lwSojwx3hRxW0SXP3vbZtuZ1
 LLGVptQgW6w6JKc2jAUNfdmVuTKDYlGHYtugtIs1ovpqty9zq+nvaOulArolD5tsir92
 y6oQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1694876824; x=1695481624;
 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=ETaO6hpcXFCrQDM3NasLz6yvQ+2G9nioPAwVPX0ELJQ=;
 b=EuX5pqMmgN7acA3v36lzs2DBPuIma4QcxgvU98KcSKqjZOaBTULubOi4WFsqSLUBdZ
 fjH4N89aPL6LKz09pt55BdZ4XV8nvfYk/mxe3Hfb+IRuOXeUvaKsK81pPeuOV7pIS48W
 fwZY0okCVjMwBBZdH3qM0w7atNS4SEqEo8B3Q4uwK8JGwHfgTPukILvOvLpu9m71Wv2Z
 fHgvkqNHsKt+LCfAxQ1C2A0fV9Iv1NeoQ9H4kexVYHVO4PJN9wk6uNsjW+2+hDcr9sNR
 o2fKt9cRI5tmMqIpwbVm4j/JmYMCEDmZShF6nVzyZt59QJXp68IpLSGYOXS/Bl9/Xyq9
 fOxw==
X-Gm-Message-State: AOJu0Yxg/0fJMZZy1AJkCafn/gGQKUD1R9fD9Fp6FcTTUwQivfcGqFU4
 MhX8KqZqs+Idyf7GL5jEGuA=
X-Google-Smtp-Source: AGHT+IGzqUn2d4D1UvKGbX2wlzZDbRMt/xdiqeUHmKzlfLhaoAeHspNgsKvUHIE8GYbPp/2Lf3jfnw==
X-Received: by 2002:a05:6a00:1882:b0:68b:f3a4:ff6b with SMTP id
 x2-20020a056a00188200b0068bf3a4ff6bmr5157560pfh.9.1694876824039; 
 Sat, 16 Sep 2023 08:07:04 -0700 (PDT)
Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161])
 by smtp.gmail.com with ESMTPSA id
 t25-20020a62ea19000000b0068c6889e146sm4764376pfh.98.2023.09.16.08.07.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 16 Sep 2023 08:07:03 -0700 (PDT)
Date: Sun, 17 Sep 2023 00:06:58 +0900
Message-ID: <eke7msxmxilp.wl-kobarity@HIDDEN>
From: kobarity <kobarity@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65870: 30.0.50;
 Error in python-mode when try to delete a character in badly-indented
 code
In-Reply-To: <83led6igai.fsf@HIDDEN>
References: <3a4467d3-f190-4115-b73a-9ae18b31a527@HIDDEN>
 <83led6igai.fsf@HIDDEN>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue)
 FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) 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_Sun_Sep_17_00:06:57_2023-1"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 65870
Cc: Daniel Lopez <daniel.lopez999@HIDDEN>, 65870 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--Multipart_Sun_Sep_17_00:06:57_2023-1
Content-Type: text/plain; charset=US-ASCII


Eli Zaretskii wrote:
> > Date: Mon, 11 Sep 2023 17:36:59 +0100
> > From: Daniel Lopez <daniel.lopez999@HIDDEN>
> > 
> > To reproduce from emacs -Q:
> >   C-x b hello.py RET
> >   M-x python-mode
> >   On the first line, type the word "return", then press the Return key.
> >   On the second line, type one or more spaces.
> >   Press Backspace. This triggers the error message:
> >       python-indent-line: Wrong type argument: wholenump, -4
> >   and, the last-typed space is not deleted.
> > 
> > Backtrace of the error:
> >   Debugger entered--Lisp error: (wrong-type-argument wholenump -4)
> >     indent-line-to(-4)
> >     python-indent-line(t)
> >     python-indent-dedent-line()
> >     python-indent-dedent-line-backspace(1)
> >     funcall-interactively(python-indent-dedent-line-backspace 1)
> >     command-execute(python-indent-dedent-line-backspace)
> > 
> > This can also happen with Python keywords/statements that tend to end a
> > scope, eg. "break" or "raise", as well as "return".
> > 
> > I guess the smart dedenting sees the "return" (or similar statement) at
> > top-level scope and then tries to move the cursor to a parent scope /
> > negative column that doesn't exist. Perhaps one of those indent
> > functions could clamp itself somehow to not do that but I'm not sure
> > where the best place for that would be.
> 
> Thanks.
> 
> kobarity, any suggestions or comments?

Thank you for the report.  The attached is the proposed fix.

--Multipart_Sun_Sep_17_00:06:57_2023-1
Content-Type: application/octet-stream; type=patch; name="0001-Fix-Python-mode-error-caused-by-incorrect-indentatio.patch"
Content-Disposition: attachment; filename="0001-Fix-Python-mode-error-caused-by-incorrect-indentatio.patch"
Content-Transfer-Encoding: 7bit

From 32f0dbe5f942ffa60f0945d2ffb771db82db5832 Mon Sep 17 00:00:00 2001
From: kobarity <kobarity@HIDDEN>
Date: Sat, 16 Sep 2023 23:14:45 +0900
Subject: [PATCH] Fix Python mode error caused by incorrect indentation

* lisp/progmodes/python.el (python-indent--calculate-indentation):
Guard against negative indentation.  (Bug #65870)

* test/lisp/progmodes/python-tests.el
(python-indent-badly-indented-block-end): New test.
---
 lisp/progmodes/python.el            | 2 +-
 test/lisp/progmodes/python-tests.el | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 4b940b3f13b..d7e49e225d8 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1660,7 +1660,7 @@ python-indent--calculate-indentation
         (`(:after-block-end . ,start)
          ;; Subtract one indentation level.
          (goto-char start)
-         (- (current-indentation) python-indent-offset))
+         (max 0 (- (current-indentation) python-indent-offset)))
         (`(:at-dedenter-block-start . ,_)
          ;; List all possible indentation levels from opening blocks.
          (let ((opening-block-start-points
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index a44a11896f0..f3456030975 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -2081,6 +2081,15 @@ python-indent-after-bare-match
    (python-tests-look-at "else:")
    (should (= (python-indent-calculate-indentation) 4))))
 
+(ert-deftest python-indent-badly-indented-block-end ()
+  "Test BUG 65870 regression."
+  (python-tests-with-temp-buffer
+   "
+return
+"
+   (goto-char (point-max))
+   (should (= (python-indent-calculate-indentation) 0))))
+
 
 ;;; Filling
 
-- 
2.34.1


--Multipart_Sun_Sep_17_00:06:57_2023-1--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#65870; Package emacs. Full text available.

Message received at 65870 <at> debbugs.gnu.org:


Received: (at 65870) by debbugs.gnu.org; 16 Sep 2023 10:06:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 16 06:06:21 2023
Received: from localhost ([127.0.0.1]:45434 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qhSBw-0003VZ-SV
	for submit <at> debbugs.gnu.org; Sat, 16 Sep 2023 06:06:21 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:55272)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qhSBu-0003VJ-Pl
 for 65870 <at> debbugs.gnu.org; Sat, 16 Sep 2023 06:06:19 -0400
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 <eliz@HIDDEN>)
 id 1qhSBh-0005bF-Ju; Sat, 16 Sep 2023 06:06:06 -0400
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=+Lj8CMFWD39e1F+QQOWONulGU3S11pxoWmllTib2CxI=; b=RO2obgqp/8AG
 kmT1qZUA3rN5G2zcB3fSHgJN+Rf01YyLv0JefA4Fap1ae4AEaJZC0lro/DN08Ffy56IIIBjBjWoqr
 jNYt6QEPWwuFyl4HXPZBfsmgmUmd62S3b113IN7iD0jGuZhoRSdrq1FkMpWvwheTs1hTl6NUtbGkf
 xDbQEGEYbiew/oqh6MIO+5xvWkYu9vUamkR9pLh9bWzpgkCBy0Yvl8wyIl+tguZLHkMUd1pXcYJB/
 m41bN3sWf6EgRlnclofGmRpNJq8mPDBNGM+/w22G5dcqzFodlP6jkzgqFYl2WIYt2hpUVF48vDTBf
 1UPl79xwEtmTAgxHdrImHA==;
Date: Sat, 16 Sep 2023 13:05:57 +0300
Message-Id: <83led6igai.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Lopez <daniel.lopez999@HIDDEN>, kobarity <kobarity@HIDDEN>
In-Reply-To: <3a4467d3-f190-4115-b73a-9ae18b31a527@HIDDEN> (message from
 Daniel Lopez on Mon, 11 Sep 2023 17:36:59 +0100)
Subject: Re: bug#65870: 30.0.50;
 Error in python-mode when try to delete a character in badly-indented
 code
References: <3a4467d3-f190-4115-b73a-9ae18b31a527@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65870
Cc: 65870 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 11 Sep 2023 17:36:59 +0100
> From: Daniel Lopez <daniel.lopez999@HIDDEN>
> 
> To reproduce from emacs -Q:
>   C-x b hello.py RET
>   M-x python-mode
>   On the first line, type the word "return", then press the Return key.
>   On the second line, type one or more spaces.
>   Press Backspace. This triggers the error message:
>       python-indent-line: Wrong type argument: wholenump, -4
>   and, the last-typed space is not deleted.
> 
> Backtrace of the error:
>   Debugger entered--Lisp error: (wrong-type-argument wholenump -4)
>     indent-line-to(-4)
>     python-indent-line(t)
>     python-indent-dedent-line()
>     python-indent-dedent-line-backspace(1)
>     funcall-interactively(python-indent-dedent-line-backspace 1)
>     command-execute(python-indent-dedent-line-backspace)
> 
> This can also happen with Python keywords/statements that tend to end a
> scope, eg. "break" or "raise", as well as "return".
> 
> I guess the smart dedenting sees the "return" (or similar statement) at
> top-level scope and then tries to move the cursor to a parent scope /
> negative column that doesn't exist. Perhaps one of those indent
> functions could clamp itself somehow to not do that but I'm not sure
> where the best place for that would be.

Thanks.

kobarity, any suggestions or comments?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#65870; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Sep 2023 16:37:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 11 12:37:32 2023
Received: from localhost ([127.0.0.1]:54647 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qfjum-0001QN-0a
	for submit <at> debbugs.gnu.org; Mon, 11 Sep 2023 12:37:32 -0400
Received: from lists.gnu.org ([2001:470:142::17]:52736)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <daniel.lopez999@HIDDEN>) id 1qfjui-0001Q8-EJ
 for submit <at> debbugs.gnu.org; Mon, 11 Sep 2023 12:37:30 -0400
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 <daniel.lopez999@HIDDEN>)
 id 1qfjuY-00004u-Iz
 for bug-gnu-emacs@HIDDEN; Mon, 11 Sep 2023 12:37:18 -0400
Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <daniel.lopez999@HIDDEN>)
 id 1qfjuS-0000nI-K3
 for bug-gnu-emacs@HIDDEN; Mon, 11 Sep 2023 12:37:18 -0400
Received: by mail-wm1-x330.google.com with SMTP id
 5b1f17b1804b1-401da71b83cso53338395e9.2
 for <bug-gnu-emacs@HIDDEN>; Mon, 11 Sep 2023 09:37:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1694450230; x=1695055030; darn=gnu.org;
 h=content-transfer-encoding:subject:from:to:content-language
 :user-agent:mime-version:date:message-id:from:to:cc:subject:date
 :message-id:reply-to;
 bh=njZH9y1AIWaZoYW7ilx3Bfs2cK8LKkMIMlxMLezk4+g=;
 b=hGk+OzacbuDfG5SV4zV1tVRvNgq/rOKWhaFRcKDqyT8rdpJt8mFKKhcA6HsydftIpZ
 R4KLdqlHTfYT1pA9zu++siFQ7ROWCY+p/977JP25RzQaMXgXfetKUkEr9H0FELYIyEaw
 WZyTf2JuaFkw4jpaZs2QVe+wGVCSWpLvKgJM50KGDcp7Hf9VX8ePAerzJV3jzFGkge8g
 GQj2HryCNO+/d697dLz8CS9wwu3ZRqT/+FlRvlebLbdzWDMTIrax7lmVaYNjc6JhTnSl
 n7kucXajfXHNuFcs9FvtkRsQ3cE854G7LQO73mExO1RTQd6i90AvuotVh513rybeVxPE
 l/aw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1694450230; x=1695055030;
 h=content-transfer-encoding:subject:from:to:content-language
 :user-agent:mime-version:date:message-id:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=njZH9y1AIWaZoYW7ilx3Bfs2cK8LKkMIMlxMLezk4+g=;
 b=smzwvrGskEWaAz4CC96bSycOB+EODf0+L7aqspM3Nz9BBAGE6JQoyn/Jkyg8m19G+K
 yAWEtHx48NkPxTfjLoFZudTfxqnzoL16orYKp2rKtt34Aaoqk+8vcQfdVVzjzv4uAUrw
 y87d3Sy8iBnFaU3Rz4pquSeNoWTdk2YMXbu4jU100q5Ucc5y/coEj4NoLmL4o2+McNmP
 DCbxUnAJGpYFkeCjV9uiH9/qxp5sinQbaZPuPlDHxG7nG/D2cQxdJ5/AGiCPj6qT0oY2
 VnwCY5tHYudrfqYzVfpOcfX3k8IfmzuW5X7AvMQv2xpdfnZFEAereRQ/aYZIjSXfpd/3
 Od0A==
X-Gm-Message-State: AOJu0Yx3iAGGI+yyN4sOiPa/KddSr+8O03fE1IUmKm2TYl+6DlVOYyoV
 Cu9BUkDS1oSGAXstjOCvx8L2+3Wt4Bs=
X-Google-Smtp-Source: AGHT+IHSVM7dPsq1Q3bO8MgCYeP2sg+r33OsQl51JpGQva6gCUSDUPllD7ts3nq6nKOXklyiJDOkxw==
X-Received: by 2002:a7b:c3d5:0:b0:401:73b2:f043 with SMTP id
 t21-20020a7bc3d5000000b0040173b2f043mr9143172wmj.1.1694450230301; 
 Mon, 11 Sep 2023 09:37:10 -0700 (PDT)
Received: from [192.168.2.2] (w-113.cust-u7457.ip.static.uno.uk.net.
 [212.105.168.113]) by smtp.googlemail.com with ESMTPSA id
 9-20020a05600c230900b003fe1a092925sm10435784wmo.19.2023.09.11.09.37.09
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 11 Sep 2023 09:37:09 -0700 (PDT)
Message-ID: <3a4467d3-f190-4115-b73a-9ae18b31a527@HIDDEN>
Date: Mon, 11 Sep 2023 17:36:59 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US-large
To: bug-gnu-emacs@HIDDEN
From: Daniel Lopez <daniel.lopez999@HIDDEN>
Subject: 30.0.50; Error in python-mode when try to delete a character in
 badly-indented code
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=2a00:1450:4864:20::330;
 envelope-from=daniel.lopez999@HIDDEN; helo=mail-wm1-x330.google.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: To reproduce from emacs -Q: C-x b hello.py RET M-x
 python-mode
 On the first line, type the word "return", then press the Return key. On
 the second line, type one or more spaces. Press Backspace. This [...] 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (daniel.lopez999[at]gmail.com)
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (daniel.lopez999[at]gmail.com)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.2 (/)

To reproduce from emacs -Q:
  C-x b hello.py RET
  M-x python-mode
  On the first line, type the word "return", then press the Return key.
  On the second line, type one or more spaces.
  Press Backspace. This triggers the error message:
      python-indent-line: Wrong type argument: wholenump, -4
  and, the last-typed space is not deleted.

Backtrace of the error:
  Debugger entered--Lisp error: (wrong-type-argument wholenump -4)
    indent-line-to(-4)
    python-indent-line(t)
    python-indent-dedent-line()
    python-indent-dedent-line-backspace(1)
    funcall-interactively(python-indent-dedent-line-backspace 1)
    command-execute(python-indent-dedent-line-backspace)

This can also happen with Python keywords/statements that tend to end a
scope, eg. "break" or "raise", as well as "return".

I guess the smart dedenting sees the "return" (or similar statement) at
top-level scope and then tries to move the cursor to a parent scope /
negative column that doesn't exist. Perhaps one of those indent
functions could clamp itself somehow to not do that but I'm not sure
where the best place for that would be.

Daniel



In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
  3.24.36, cairo version 1.17.8) of 2023-02-21 built on ENO
Repository revision: 098add06eb7d742ff0e6ee0e294931a93a60c71c
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Arch Linux

Configured using:
  'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
  --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
  --with-modules --without-libotf --without-m17n-flt --without-gconf
  --with-native-compilation=yes --with-xinput2 --with-x-toolkit=gtk3
  --without-xaw3d --with-sound=no --with-tree-sitter --without-gpm
  --without-compress-install
  '--program-transform-name=s/\([ec]tags\)/\1.emacs/'
  'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions
  -Wp,-D_FORTIFY_SOURCE=2 -Wformat -fstack-clash-protection
  -fcf-protection'
  LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG
RSVG SECCOMP SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP
X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
   value of $LANG: en_GB.UTF-8
   locale-coding-system: utf-8-unix

Major mode: Python

Minor modes in effect:
   tooltip-mode: t
   global-eldoc-mode: t
   eldoc-mode: t
   show-paren-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   line-number-mode: t
   transient-mark-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-fns
radix-tree cl-print debug backtrace find-func python project byte-opt
pcase treesit comint ansi-osc ring cl-loaddefs comp comp-cstr warnings
icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp
byte-compile cl-lib ansi-color cus-start cus-load 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 105838 7866)
  (symbols 48 9884 0)
  (strings 32 26714 1992)
  (string-bytes 1 822994)
  (vectors 16 18667)
  (vector-slots 8 375164 12614)
  (floats 8 37 45)
  (intervals 56 310 0)
  (buffers 984 13))




Acknowledgement sent to Daniel Lopez <daniel.lopez999@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#65870; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 3 Jun 2024 12:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.