From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Lopez Newsgroups: gmane.emacs.bugs Subject: bug#65870: 30.0.50; Error in python-mode when try to delete a character in badly-indented code Date: Mon, 11 Sep 2023 17:36:59 +0100 Message-ID: <3a4467d3-f190-4115-b73a-9ae18b31a527@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30876"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 65870@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 11 18:38:22 2023 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 1qfjvZ-0007on-9E for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Sep 2023 18:38:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfjvD-0000Vi-N1; Mon, 11 Sep 2023 12:37:59 -0400 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 1qfjvC-0000VX-8y for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2023 12:37:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfjvC-0000yv-1F for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2023 12:37:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qfjvF-0001R8-Qi for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2023 12:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Lopez Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Sep 2023 16:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65870 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16944502525485 (code B ref -1); Mon, 11 Sep 2023 16:38:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Sep 2023 16:37:32 +0000 Original-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 Original-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 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 1qfjuY-00004u-Iz for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2023 12:37:18 -0400 Original-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 Original-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) Original-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) Content-Language: en-US-large 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270062 Archived-At: 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))