From unknown Fri Aug 15 14:48:31 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#65870 <65870@debbugs.gnu.org> To: bug#65870 <65870@debbugs.gnu.org> Subject: Status: 30.0.50; Error in python-mode when try to delete a character in badly-indented code Reply-To: bug#65870 <65870@debbugs.gnu.org> Date: Fri, 15 Aug 2025 21:48:31 +0000 retitle 65870 30.0.50; Error in python-mode when try to delete a character = in badly-indented code reassign 65870 emacs submitter 65870 Daniel Lopez severity 65870 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 11 12:37:32 2023 Received: (at submit) by debbugs.gnu.org; 11 Sep 2023 16:37:32 +0000 Received: from localhost ([127.0.0.1]:54647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfjum-0001QN-0a for submit@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 ) id 1qfjui-0001Q8-EJ for submit@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 ) id 1qfjuY-00004u-Iz for bug-gnu-emacs@gnu.org; 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 ) id 1qfjuS-0000nI-K3 for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2023 12:37:18 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-401da71b83cso53338395e9.2 for ; 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 (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@gmail.com> 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@gnu.org From: Daniel Lopez 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@gmail.com; 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@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.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)) From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 16 06:06:21 2023 Received: (at 65870) by debbugs.gnu.org; 16 Sep 2023 10:06:21 +0000 Received: from localhost ([127.0.0.1]:45434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhSBw-0003VZ-SV for submit@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 ) id 1qhSBu-0003VJ-Pl for 65870@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 ) 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@gnu.org> From: Eli Zaretskii To: Daniel Lopez , kobarity In-Reply-To: <3a4467d3-f190-4115-b73a-9ae18b31a527@gmail.com> (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@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65870 Cc: 65870@debbugs.gnu.org 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 (---) > Date: Mon, 11 Sep 2023 17:36:59 +0100 > From: Daniel Lopez > > 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? From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 16 11:07:20 2023 Received: (at 65870) by debbugs.gnu.org; 16 Sep 2023 15:07:20 +0000 Received: from localhost ([127.0.0.1]:48268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhWtD-0000cm-Nc for submit@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 ) id 1qhWtB-0000c7-3B for 65870@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@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: From: kobarity To: Eli Zaretskii 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@gnu.org> References: <3a4467d3-f190-4115-b73a-9ae18b31a527@gmail.com> <83led6igai.fsf@gnu.org> 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 , 65870@debbugs.gnu.org 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_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 > > > > 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 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-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 17 00:06:50 2023 Received: (at 65870) by debbugs.gnu.org; 17 Sep 2023 04:06:50 +0000 Received: from localhost ([127.0.0.1]:48842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhj3Z-00024n-Op for submit@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 ) id 1qhj3W-00024X-Gg for 65870@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@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: 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 , Eli Zaretskii References: <3a4467d3-f190-4115-b73a-9ae18b31a527@gmail.com> <83led6igai.fsf@gnu.org> From: Daniel Lopez In-Reply-To: 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@debbugs.gnu.org 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.7 (/) On 16/09/2023 16:06, kobarity wrote: > > Eli Zaretskii wrote: >>> Date: Mon, 11 Sep 2023 17:36:59 +0100 >>> From: Daniel Lopez >>> >>> 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. :) From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 02 17:08:57 2024 Received: (at 65870) by debbugs.gnu.org; 2 Jun 2024 21:08:57 +0000 Received: from localhost ([127.0.0.1]:40236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDsRl-0004xq-D7 for submit@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 ) id 1sDsRj-0004xP-2X for 65870@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 From: =?utf-8?Q?Jakub_Je=C4=8Dm=C3=ADnek?= 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@kubajecminek.cz> 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 , Daniel Lopez , 65870@debbugs.gnu.org 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.3 (/) kobarity 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 > 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= . From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 03 08:10:21 2024 Received: (at 65870) by debbugs.gnu.org; 3 Jun 2024 12:10:21 +0000 Received: from localhost ([127.0.0.1]:34565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sE6W4-0002pA-Kp for submit@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 ) id 1sE5rc-00010k-8S for 65870@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 ) 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@gnu.org> From: Eli Zaretskii To: Jakub =?utf-8?B?SmXEjW3DrW5law==?= In-Reply-To: <87jzj7xdbo.fsf@kubajecminek.cz> (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@kubajecminek.cz> 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@gmail.com, daniel.lopez999@gmail.com, 65870@debbugs.gnu.org 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: -2.6 (--) > Date: Sun, 02 Jun 2024 21:08:30 +0000 > From: Jakub Ječmínek > Cc: kobarity , Daniel Lopez , 65870@debbugs.gnu.org > > kobarity 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 04 01:13:18 2024 Received: (at submit) by debbugs.gnu.org; 4 Jun 2024 05:13:18 +0000 Received: from localhost ([127.0.0.1]:56143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEMU2-0002y8-HK for submit@debbugs.gnu.org; Tue, 04 Jun 2024 01:13:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:52818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEMTx-0002xy-Tn for submit@debbugs.gnu.org; Tue, 04 Jun 2024 01:13:17 -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 ) id 1sEMTi-0007Zq-IG for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 01:13:00 -0400 Received: from mout.kundenserver.de ([217.72.192.74]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEMTg-0005Kl-Oz for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 01:12:58 -0400 Received: from [192.168.178.61] ([89.247.171.240]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MYN7M-1s0f5D1N8k-00VRJE for ; Tue, 04 Jun 2024 07:12:53 +0200 Message-ID: Date: Tue, 4 Jun 2024 07:12:52 +0200 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 To: bug-gnu-emacs@gnu.org References: <87jzj7xdbo.fsf@kubajecminek.cz> <867cf6mfne.fsf@gnu.org> Content-Language: en-US From: =?UTF-8?Q?Andreas_R=C3=B6hler?= In-Reply-To: <867cf6mfne.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:wnWNB8WdUxSrMRND8/7ZEGxfJTR0l2fa0xJwTy2NPIAL2ggl9W2 yLwqJTDhQTMiQZTXnjX9nY9+oa7tfDznWtQVVurEUtB/eBgHPr0MzUBKR+ePOoMgBcPikzD M0a0RQh3ZprxzMZ9b0QltVIGIRuMG83cr7GmQONj0KZM5SHfaRrYKjp2Q+IfSkxhFJt4x2D 3X/DSZu+SHoIz9373WQPQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:/CVN/KG4UyM=;2xln1r2a8nAjMqPRl+b5AQyVtY8 tt40Zkk7KORi1osXi3dYvVc9zqJ90FMNPz7bc/aEjsjF0EHsMqSXZn9pfeuQzSk5hw02M1PY+ E/OLg4TGVfx4lIDzVpA/7kUfo0IlrIBF4kje2a1iiwoj2DCIz0poEZ/1PLhVDsM6FtAAgIK3r eXPXsp2ls353H8vaeYj1RbBwrvgBeDCX8VYzgRKO1H7szmrRgWk3R90A8+aATnUtXU/7E742T umTlAKqhIV0SnpGRu3Ta0gleEMDh5or9eudCt5SW+BV0zlUBTIuFrL7/sn2GajHEVzFqf88K2 y7KtKZFj90dS81rRQiMr+RPNsO9iavnOk4orUC/VeQjpln0wbyOHaPSsqNR+aM4o8ilr3I7+c XBMZz1yR18e2TwrufUf/QhAKGFq7s39atzlWx18EZllnCnWaqdtvfGWptFCGVjEryDJ1TR21i jFKcDJaO9Hi/9t/4nuOVHuyeCoX69y+AO/zD/GBCd+8xzAasQRCgD477BOOrFng1YyCLeX7Ub Ax5ygn1ofMM2pRyk4dM6gXxXSOORk4J+1j5oC9hc6m5Jq+eLIywxXNygMyHHQKwtkfU1ZdeLD kZuwxqHvAKHOU+E0lX9ZDQvSd0taoydGsvszeTZOrVuevmHh58Z2dG3R2IIvXnaI30gt9RxUQ Be/xjfv835jYUVrBgWMZVXLvtdM14pVyBDAWwBi4gZHTjJ04gEPA3Ul4VRUygzFEYytEJuwxm YoWwgxWNo8iDPOi3zpxWF58qmTfdsVotsBq0CIzVfdUtEU5TWFYpQM= Received-SPF: pass client-ip=217.72.192.74; envelope-from=andreas.roehler@easy-emacs.de; helo=mout.kundenserver.de X-Spam_score_int: 14 X-Spam_score: 1.4 X-Spam_bar: + X-Spam_report: (1.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 3.0 (+++) 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: Am 03.06.24 um 13:25 schrieb Eli Zaretskii: >> Date: Sun, 02 Jun 2024 21:08:30 +0000 >> From: Jakub Ječmínek >> Cc: kobarity , Daniel Lopez List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) 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: Am 03.06.24 um 13:25 schrieb Eli Zaretskii: >> Date: Sun, 02 Jun 2024 21:08:30 +0000 >> From: Jakub Ječmínek >> Cc: kobarity , Daniel Lopez > Date: Sun, 02 Jun 2024 21:08:30 +0000 >> From: Jakub Ječmínek >> Cc: kobarity , Daniel Lopez , 65870@debbugs.gnu.org >> >> kobarity 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. > > > May reproduce a bug: From col 4 at an empty second line, BACKSPACE  doesn't move. Instead sends the error: indent-line-to: Wrong type argument: wholenump, -4 [2 times] --- C-h k BACKSPACE: DEL (translated from ) runs the command python-indent-dedent-line-backspace (found in python-mode-map), which is an interactive byte-code-function in ‘python.el’. It is bound to DEL. (python-indent-dedent-line-backspace ARG) De-indent current line. Argument ARG is passed to ‘backward-delete-char-untabify’ when point is not in between the indentation. --- GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2024-06-03 From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 04 01:46:12 2024 Received: (at submit) by debbugs.gnu.org; 4 Jun 2024 05:46:12 +0000 Received: from localhost ([127.0.0.1]:56167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEMzs-0003qY-AX for submit@debbugs.gnu.org; Tue, 04 Jun 2024 01:46:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:38288) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEMzo-0003qN-N7 for submit@debbugs.gnu.org; Tue, 04 Jun 2024 01:46:10 -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 ) id 1sEMzO-0006PS-UQ for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 01:45:54 -0400 Received: from mout.kundenserver.de ([217.72.192.75]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEMzK-0000Ww-RK for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 01:45:40 -0400 Received: from [192.168.178.61] ([89.247.171.240]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N3KDM-1se77K2AWA-010M0h for ; Tue, 04 Jun 2024 07:45:36 +0200 Message-ID: Date: Tue, 4 Jun 2024 07:45:35 +0200 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 To: bug-gnu-emacs@gnu.org References: <87jzj7xdbo.fsf@kubajecminek.cz> <867cf6mfne.fsf@gnu.org> Content-Language: en-US From: =?UTF-8?Q?Andreas_R=C3=B6hler?= In-Reply-To: <867cf6mfne.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:6tRYTtWcbO7G/ZRxdIN9/8bdUbGRgszH8wNt6jkn4wv0TtMH8ju 1d4UObr4UW2gfUmpOyMDnPdsFFLzyWC+UTr1NtKJyvVsLm5NxE5TcEVDUInbMEMUQp5XpXE 5GHBIlElIBMFXTzwf8ZR1bIBTLPIBCpZ2RVPPhyNLR13LwIaVWrbqTelzNqwO92oXbUAcpl VKoX6WhRFBVvUSdULdIfw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:70pHTzttBYs=;IR2YHykDml9pEJIzwcgsVl+RMwn t6MOrcERRqgzLfORiM9z8O5CSPIhoOvMLYPHKqmULHIw4rMhqpnJIExjjQS20TVToHZGYqRoB oy1dbcqej2OaKXbMgpulLUDcYFvtU0nJEwz+UfXOG29eGeD1YwgVLEFfJDb47C6nVWzcDCQzO au0mL07mAuUMve+wdmQ0FLuzYGmXh874g7gb26Tyk7E++A6JSFIwxfq2VugwtVh8lruc7+kOX HUlxfaQUuU3yL8poULDOKQJkLBUaZLrMFdiDhWekrT6Or57IGDL8gO1CPi9BOR9Wf6ZyXp0ad RZ2+PapDInylLtf0t7NyOEdLXYtitwpNwhE0oCCihVwBeTLBcFGKwaugFFaJFFrgrwFtdrDrU c8rlCYsMV4jShC/qO2DhPhmQS5jYZarXh18Z/TJUSN/UgOnQcbyNlgjEi1cEz09opbsSkrXDC GEfDnzyI5tqsY++9QV4vTeuBwBq6ps5FbpD+chsyCqEa4EjzlHY9vt2Uqa5OW+KxafdT22kIq Hy8+2A8rhTKsFj7M+prTLYbx6hO06liPRvTPgLJcQzo1Y+NXrWPNGDybVII7xJ6yiSdn5GKwE bhZYQqjGA/VFACCi7O8Rry/+4iD4UZd2NVZe06LIPCbDz5klahbSznkrdXPNwBCiJI3In91hY AWYQoFn8f93BGfjsgUqnY6WXMoDMJ9iFsmwvXGFHUJkx3RjHBUyvlaFWPFOwf1tiun/KDEbL3 v4OSHsNPYmhaNpx1wbub2dW5zQSLtsBhWhBbvO7UwuLW1rW+U8lPnc= Received-SPF: pass client-ip=217.72.192.75; envelope-from=andreas.roehler@easy-emacs.de; helo=mout.kundenserver.de X-Spam_score_int: 14 X-Spam_score: 1.4 X-Spam_bar: + X-Spam_report: (1.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 3.0 (+++) 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: Am 03.06.24 um 13:25 schrieb Eli Zaretskii: >> Date: Sun, 02 Jun 2024 21:08:30 +0000 >> From: Jakub Ječmínek >> Cc: kobarity , Daniel Lopez List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) 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: Am 03.06.24 um 13:25 schrieb Eli Zaretskii: >> Date: Sun, 02 Jun 2024 21:08:30 +0000 >> From: Jakub Ječmínek >> Cc: kobarity , Daniel Lopez > Date: Sun, 02 Jun 2024 21:08:30 +0000 >> From: Jakub Ječmínek >> Cc: kobarity , Daniel Lopez , 65870@debbugs.gnu.org >> >> kobarity 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. > > > patched against GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2024-06-04 seems to work From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 08 08:29:51 2024 Received: (at 65870-done) by debbugs.gnu.org; 8 Jun 2024 12:29:51 +0000 Received: from localhost ([127.0.0.1]:37724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFvCg-0003S9-UW for submit@debbugs.gnu.org; Sat, 08 Jun 2024 08:29:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFvCe-0003Ru-2w for 65870-done@debbugs.gnu.org; Sat, 08 Jun 2024 08:29:49 -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 ) id 1sFvCJ-0005y1-0T; Sat, 08 Jun 2024 08:29:27 -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=dZYgBdVUejGA0NMQ22SsOMHqy5xTYXE8E5HzUHKwAb0=; b=pNrFr2aSlQLU 2wYSVRkuRD+nWNx+cBGFFRZwMFg1IrOKcvaJqMmIlLzl4moAqlagP5W4MCyyd5QHfNlKBTbIOaCZG QUA4eo47SCIlOg7iamgQskbmYjZSEyANCgxueCYTktP97xgQSOHMm+TBmYQtkjJpJ8piHudjLsAdq WaKre7c9O7gW3Lw76ZNR3VlnDl0zTCg3THWsfRWU+V0n67qsQGIzLCt2sK8UI7hBdPsygaxZuwc7F O80mj+z9Lb/NRbX2FjjCtcGPv8J3Pp3WZK0S38CrotGbFYuJBuoEOq4ZXnkTkH0jH80SEzdxhlL2o pwl4s+9zkk1pkLsg3LySgQ==; Date: Sat, 08 Jun 2024 15:29:19 +0300 Message-Id: <86jzizd3ds.fsf@gnu.org> From: Eli Zaretskii To: kobarity In-Reply-To: (message from kobarity on Sun, 17 Sep 2023 00:06:58 +0900) 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@gmail.com> <83led6igai.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65870-done Cc: 65870-done@debbugs.gnu.org, daniel.lopez999@gmail.com 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 (---) > Date: Sun, 17 Sep 2023 00:06:58 +0900 > From: kobarity > Cc: Daniel Lopez , > 65870@debbugs.gnu.org > > Eli Zaretskii wrote: > > > Date: Mon, 11 Sep 2023 17:36:59 +0100 > > > From: Daniel Lopez > > > > > > 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. Thanks, installed on the master branch, and closing the bug. From unknown Fri Aug 15 14:48:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 07 Jul 2024 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator