From unknown Mon Jun 23 04:10:18 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#18796 <18796@debbugs.gnu.org> To: bug#18796 <18796@debbugs.gnu.org> Subject: Status: 24.4; python indent-for-tab-command fails to recognize if-elif-else Reply-To: bug#18796 <18796@debbugs.gnu.org> Date: Mon, 23 Jun 2025 11:10:18 +0000 retitle 18796 24.4; python indent-for-tab-command fails to recognize if-eli= f-else=20 reassign 18796 emacs submitter 18796 Carlos Pita severity 18796 normal tag 18796 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 22 12:36:13 2014 Received: (at submit) by debbugs.gnu.org; 22 Oct 2014 16:36:13 +0000 Received: from localhost ([127.0.0.1]:60070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XgytQ-0004Bb-IO for submit@debbugs.gnu.org; Wed, 22 Oct 2014 12:36:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55557) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XgytN-0004BO-NO for submit@debbugs.gnu.org; Wed, 22 Oct 2014 12:36:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgytC-0001Ne-L5 for submit@debbugs.gnu.org; Wed, 22 Oct 2014 12:36:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgytC-0001Na-Hv for submit@debbugs.gnu.org; Wed, 22 Oct 2014 12:35:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xgyt6-0006Fn-Fc for bug-gnu-emacs@gnu.org; Wed, 22 Oct 2014 12:35:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xgyt0-0001LL-F2 for bug-gnu-emacs@gnu.org; Wed, 22 Oct 2014 12:35:52 -0400 Received: from mail-qc0-x235.google.com ([2607:f8b0:400d:c01::235]:46644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xgyt0-0001L9-9L for bug-gnu-emacs@gnu.org; Wed, 22 Oct 2014 12:35:46 -0400 Received: by mail-qc0-f181.google.com with SMTP id r5so3036101qcx.12 for ; Wed, 22 Oct 2014 09:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type; bh=cUQYJ6C11X7xtnwllmgoFyOAg1To/V3sPksMiELTa40=; b=er0fl35QUGDYCZ83z05M4LloUYP6+ICoG7ZmlTvrEw8tHEumICT67GP/uluUN50ZV4 +rCdbbegMsYw3PqcfE5andALd+Z9YN3fiw3M6zb143sVXCcph3KukVXKkaljZOccxrnw n2mTMkwW6toUNVMPQv0BNCrXxzVwRZOQBWjvDa8+dOdeyXgynxwHtxpbV7gkPEVy1+O+ w99Mb6foId6DmJySUgnO2WrVh20QIlBnkYzGc7W8K9F/jMr4LcoeB3x5OlgeXgzcVUij 4/TfQZB55zL5wB9HpXFv6cg4ERJSLcOSiyZOJEjtXEwYdY1aP2gngxoXKSErtpXjP5CD KTHQ== X-Received: by 10.140.48.233 with SMTP id o96mr54980746qga.47.1413995743992; Wed, 22 Oct 2014 09:35:43 -0700 (PDT) Received: from carlos ([190.216.58.35]) by mx.google.com with ESMTPSA id h79sm13972110qgd.27.2014.10.22.09.35.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Oct 2014 09:35:42 -0700 (PDT) From: Carlos Pita To: bug-gnu-emacs@gnu.org Subject: 24.4; python indent-for-tab-command fails to recognize if-elif-else Date: Wed, 22 Oct 2014 13:52:44 -0300 Message-ID: <82d29k3v37.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: fabian@anue.biz X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -4.0 (----) While in python-mode select the following code and press tab: def f(): if True: pass else: pass You will get: def f(): if True: pass else: pass Which is clearly wrong. I understand that auto-indenting python could be a difficult task. Maybe there's a rationale for the above behavior I can't grasp. But the result is somewhat surprising for the unaware. ------------------------- In GNU Emacs 24.4.1 (i686-pc-linux-gnu, GTK+ Version 3.12.2) of 2014-10-22 on carlos Windowing system distributor `The X.Org Foundation', version 11.0.11502000 Configured using: `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=gtk3 --with-xft 'CFLAGS=-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro' Important settings: value of $LC_COLLATE: C value of $LC_TIME: es_AR.UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Python Minor modes in effect: show-paren-mode: t shell-dirtrack-mode: t eldoc-mode: t yas-global-mode: t yas-minor-mode: t ido-ubiquitous-mode: t ido-everywhere: t winner-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-e e l s e : 0 C-a C-SPC C-SPC C-w C-x C-s C-h f i n d e n t - f o r q SPC SPC SPC SPC SPC C-a C-SPC C-/ i f SPC T r u e : C-a C-d C-k i f SPC T r u e : C-a C-SPC C-/ C-/ p a s s e l s e SPC SPC SPC SPC p a s s C-/ C-a C-SPC C-e : C-a C-SPC d e d e f SPC x x x x ( ) : M-d d f C-a C-SPC C-a C-SPC C-/ C-SPC M-w M-x r e p o r t - e m Recent messages: Mark activated Closes elif argv[1] == "send": Undo! [3 times] Mark set Closes if True: Mark activated [2 times] Closes if True: Mark set Undo! Mark activated Load-path shadows: ~/.emacs.d/lisp/rmail hides /usr/share/emacs/24.4/lisp/mail/rmail Features: (nnir qp gnus-dup mule-util debug misearch multi-isearch jka-compr oauth2 warnings plstore cus-edit cus-start cus-load eieio-opt speedbar sb-image ezimage dframe python json tramp-cache tramp tramp-compat tramp-loaddefs trampver mailalias smtpmail pp shadow emacsbug sendmail rect url-queue timezone shr-color color url-http url-gw url-auth eww mm-url shr sort smiley gnus-cite mail-extr gnus-async gnus-bcklg gnus-ml disp-table gnus-topic nndraft nnmh nnfolder utf-7 gnutls network-stream starttls nnimap parse-time tls utf7 netrc gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp gnus-cache google-contacts-gnus gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum nnoo gnus-group gnus-undo nnmail mail-source google-contacts-message google-contacts xml url-cache url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf mailcap url-util url-parse auth-source eieio byte-opt bytecomp byte-compile cconv eieio-core password-cache url-vars google-oauth gnus-start gnus-spec gnus-int gnus-range message idna rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems nnheader gnus-util mail-utils mm-util mail-prsvr wid-edit vc-git epa-file epa derived epg server paredit edmacro kmacro paren cl-macs ob-python ob-R org org-macro org-footnote org-pcomplete org-list org-faces org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs org-loaddefs find-func cal-menu calendar cal-loaddefs ess-toolbar ess-mouse mouseme thingatpt browse-url ess-menu ess-swv ess-noweb ess-noweb-font-lock-mode ess-bugs-l essd-els ess-sas-d ess-sas-l ess-sas-a shell pcomplete ess-sta-d ess-sta-l cc-vars cc-defs make-regexp ess-sp6-d ess-sp3-d ess-julia ess-r-d compile ess-tracebug format-spec ess-roxy hideshow ess-help ess-developer ess-r-args eldoc ess-s-l ess ess-inf comint ansi-color ess-mode ess-noweb-mode ess-utils time-date ess-custom executable ess-compat ess-site yasnippet help-mode cl gv ido-ubiquitous cl-loaddefs cl-lib advice help-fns imenu-anywhere imenu ido windmove winner ring info easymenu package epg-config wombat-theme tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 8 557759 103077) (symbols 24 46775 0) (miscs 20 5488 3171) (strings 16 166668 3684) (string-bytes 1 4655761) (vectors 8 48281) (vector-slots 4 1634972 78634) (floats 8 1011 1185) (intervals 28 21468 2483) (buffers 512 63) (heap 1024 81411 3306)) From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 22 13:00:47 2014 Received: (at 18796) by debbugs.gnu.org; 22 Oct 2014 17:00:47 +0000 Received: from localhost ([127.0.0.1]:60087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XgzHD-0004pe-5V for submit@debbugs.gnu.org; Wed, 22 Oct 2014 13:00:47 -0400 Received: from mail-la0-f51.google.com ([209.85.215.51]:33506) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XgzHA-0004pN-1N for 18796@debbugs.gnu.org; Wed, 22 Oct 2014 13:00:45 -0400 Received: by mail-la0-f51.google.com with SMTP id ge10so3323040lab.38 for <18796@debbugs.gnu.org>; Wed, 22 Oct 2014 10:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=9XiwjKH1sZIuxHRdntgdSuwEeLzeRlpwVeXOq+ozc3E=; b=HzgdHNQO//FkRlTK7lCPmPrnIubyTDS3o3xZTAtm6u2SsZU2Dk4AvopNzzkbS2NjK9 M2NyfNrY6ZTwTyLaHGJP5V5Rpb6kAXbKIisMXa6HX7JSv4YU4jdQtNNVyDmIsOuKpGvT n8ImmFsKcbHmjyM9ll98mgRlYcrHYn9QDUuvNU4D8U8uTDm3p+FEgRc8NA3Xfqlv7Gwf OqSgBYcJNOlDyZRri1BND1ZSVm9i3s95lBQtM6J9RcmnBI28jpCkeynKG3F62hnsYexV UbYmAKM6/AMuJH4m6S+an9fy4yub3s+nDrHoc2GEjeoR2M/t5MisFTK3WG7pxJN9mgTE lBfg== X-Received: by 10.112.137.39 with SMTP id qf7mr42497223lbb.47.1413997237867; Wed, 22 Oct 2014 10:00:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.252.101 with HTTP; Wed, 22 Oct 2014 10:00:17 -0700 (PDT) From: Carlos Pita Date: Wed, 22 Oct 2014 14:00:17 -0300 Message-ID: Subject: To: 18796@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Besides, pressing tab while the point is over "else:" and no region is active correctly reports "Closes if..." in the echo area and keeps the indentation level right. So somehow the indentation logic is there, just failing for the region. [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (carlosjosepita[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.51 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 2.0 BLANK_SUBJECT Subject is present but empty 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Debbugs-Envelope-To: 18796 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Besides, pressing tab while the point is over "else:" and no region is active correctly reports "Closes if..." in the echo area and keeps the indentation level right. So somehow the indentation logic is there, just failing for the region. [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.51 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (carlosjosepita[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 2.0 BLANK_SUBJECT Subject is present but empty 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid Besides, pressing tab while the point is over "else:" and no region is active correctly reports "Closes if..." in the echo area and keeps the indentation level right. So somehow the indentation logic is there, just failing for the region. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 22 14:11:53 2014 Received: (at 18796) by debbugs.gnu.org; 22 Oct 2014 18:11:53 +0000 Received: from localhost ([127.0.0.1]:60203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xh0O1-0006kN-4Y for submit@debbugs.gnu.org; Wed, 22 Oct 2014 14:11:53 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:50615) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xh0Ny-0006k9-TQ for 18796@debbugs.gnu.org; Wed, 22 Oct 2014 14:11:51 -0400 Received: by mail-lb0-f179.google.com with SMTP id l4so3308417lbv.38 for <18796@debbugs.gnu.org>; Wed, 22 Oct 2014 11:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc:content-type; bh=CAmZ5NkIcArpgCjobxQOzrfaG7qv7pjiD03OMTq7quU=; b=NtQ9HmY6O+QIJTVG7co4jIxXVmiVoFaA83tYb9Ydrhut6OjxhlMoDwG4ecC4grDu6t WqZJw7GqilxLJm+z/ExWUPGM1CDjyA0oDf1e2TAitUuVE0BaKjhYyerr6rgYkUxY0/2J C0qaY5/xHriC5rr2/CziZUMiqb6IqeNvyWI+OOkLz4y064Q7iFJcD+1VdywgXNFcNppf GMITKHrEQuEKDcNkY1ADxwEj0P334I+itRjsydceKCm7MxjxcpTI5EruIIhVaM55Kh6g syP6InceMaAUth1S9cc5orsy3VqVGe35Dg8H4ULtdrWV/xvmCKFJCF00qKXHK8ThelRd FvgQ== X-Received: by 10.152.36.230 with SMTP id t6mr4552158laj.88.1414001504554; Wed, 22 Oct 2014 11:11:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.252.101 with HTTP; Wed, 22 Oct 2014 11:11:24 -0700 (PDT) From: Carlos Pita Date: Wed, 22 Oct 2014 15:11:24 -0300 Message-ID: Subject: To: 18796@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I've doing some debugging. I found out why the bug happens, but I still have to think of a way to fix it: Say you are in a dedenter line like "else:". In python-indent-region delete-horizontal-space gets executed, so the dedenter "else:" moves to the first column and the current indentation becomes 0. Now python-info-dedenter-opening-block-position initializes indentation as the value returned by (current-indentation), that is 0. Then the opening block position is calculated and the following code gets executed: [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (carlosjosepita[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.217.179 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 2.0 BLANK_SUBJECT Subject is present but empty 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Debbugs-Envelope-To: 18796 Cc: fabian@anue.biz X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I've doing some debugging. I found out why the bug happens, but I still have to think of a way to fix it: Say you are in a dedenter line like "else:". In python-indent-region delete-horizontal-space gets executed, so the dedenter "else:" moves to the first column and the current indentation becomes 0. Now python-info-dedenter-opening-block-position initializes indentation as the value returned by (current-indentation), that is 0. Then the opening block position is calculated and the following code gets executed: [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.217.179 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (carlosjosepita[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 2.0 BLANK_SUBJECT Subject is present but empty 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid I've doing some debugging. I found out why the bug happens, but I still have to think of a way to fix it: Say you are in a dedenter line like "else:". In python-indent-region delete-horizontal-space gets executed, so the dedenter "else:" moves to the first column and the current indentation becomes 0. Now python-info-dedenter-opening-block-position initializes indentation as the value returned by (current-indentation), that is 0. Then the opening block position is calculated and the following code gets executed: (if (<= (current-indentation) indentation) (setq position (car positions)) (setq positions (cdr positions))))) In this code (current-indentation) returns the indentation of the opening block, which is fine. But it gets compared to indentation, which is always 0. So the else branch is taken every time and positions is set to nil (cdr positions). Obviously the problem is that at the point python-info-dedenter-opening-block-position is called the original dedenter indentation was lost. Maybe the original indentation should be saved as a dynamic variable before deleting the horizontal space. Or the horizontal space shouldn't be deleted at all and indentation should happen as a displacement from the original position instead of a displacement from the left margin. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 22 14:20:54 2014 Received: (at 18796) by debbugs.gnu.org; 22 Oct 2014 18:20:54 +0000 Received: from localhost ([127.0.0.1]:60214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xh0Wj-0006zC-Ta for submit@debbugs.gnu.org; Wed, 22 Oct 2014 14:20:54 -0400 Received: from mail-lb0-f180.google.com ([209.85.217.180]:61572) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xh0Wh-0006yr-67 for 18796@debbugs.gnu.org; Wed, 22 Oct 2014 14:20:51 -0400 Received: by mail-lb0-f180.google.com with SMTP id n15so3256038lbi.25 for <18796@debbugs.gnu.org>; Wed, 22 Oct 2014 11:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=qRibzo5sOyWExUggmewWwcfX+1tshU2zIRPwecJ8Obk=; b=yN70dvvY3HX0LQ8cMhVzwVDQ17xMhRBc5IvuINvgETrFa7NRdxsXp9vqFaCi06l7re QwHQbh+zdjwzanr7NO9K2jzGp2eroqpQ0ya1oEwgyaUVIxHllVl5yGH3Db2KNi1+++oy ytCtqJ5WNbPHRH5RF6QK/XAy9A4Re0s9TMpyjYkxVp7rqOS/90CayIPrOAUWVSBWn0GN XA0NJ1UkVdvdtQBsXbKB4hd+Zl6n9pwa26RsKxi+S/iNp/Wvo9ebX6GRQUhj/qSRvHSe TBY9ti2EAZh8gquBBGlIUUkS7a6Z2wA3+AkPPG5FDsHozaKDKg89XFXlRp34Ct9Ye/kT z+Wg== X-Received: by 10.152.121.68 with SMTP id li4mr42563641lab.77.1414002044865; Wed, 22 Oct 2014 11:20:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.252.101 with HTTP; Wed, 22 Oct 2014 11:20:23 -0700 (PDT) In-Reply-To: References: From: Carlos Pita Date: Wed, 22 Oct 2014 15:20:23 -0300 Message-ID: Subject: Re: To: 18796@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18796 Cc: fabian@anue.biz X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) This fix seems to work: In python-indent-region replace: (delete-horizontal-space) (indent-to (python-indent-calculate-indentation))))) for (let ((indentation (python-indent-calculate-indentation))) (delete-horizontal-space) (indent-to indentation))))) So the new indentation is calculated on the basis of the original one (that is, before removing horizontal space). On Wed, Oct 22, 2014 at 3:11 PM, Carlos Pita wrote: > I've doing some debugging. I found out why the bug happens, but I > still have to think of a way to fix it: > > Say you are in a dedenter line like "else:". In python-indent-region > delete-horizontal-space gets executed, so the dedenter "else:" moves > to the first column and the current indentation becomes 0. Now > python-info-dedenter-opening-block-position initializes indentation as > the value returned by (current-indentation), that is 0. Then the > opening block position is calculated and the following code gets > executed: > > (if (<= (current-indentation) indentation) > (setq position (car positions)) > (setq positions (cdr positions))))) > > In this code (current-indentation) returns the indentation of the > opening block, which is fine. But it gets compared to indentation, > which is always 0. So the else branch is taken every time and > positions is set to nil (cdr positions). > > Obviously the problem is that at the point > python-info-dedenter-opening-block-position is called the original > dedenter indentation was lost. > > Maybe the original indentation should be saved as a dynamic variable > before deleting the horizontal space. Or the horizontal space > shouldn't be deleted at all and indentation should happen as a > displacement from the original position instead of a displacement from > the left margin. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 31 12:38:36 2014 Received: (at control) by debbugs.gnu.org; 31 Oct 2014 16:38:36 +0000 Received: from localhost ([127.0.0.1]:41430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XkFDg-0005zh-5J for submit@debbugs.gnu.org; Fri, 31 Oct 2014 12:38:36 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:53863 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XkFDd-0005zU-W0 for control@debbugs.gnu.org; Fri, 31 Oct 2014 12:38:34 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XkFDd-0003jw-61 for control@debbugs.gnu.org; Fri, 31 Oct 2014 12:38:33 -0400 Date: Fri, 31 Oct 2014 12:38:33 -0400 Message-Id: Subject: control message for bug 18843 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.6 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.6 (-----) merge 18432 18796 18843 From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 05 15:35:39 2014 Received: (at control) by debbugs.gnu.org; 5 Nov 2014 20:35:39 +0000 Received: from localhost ([127.0.0.1]:50458 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xm7Ip-0000mR-8I for submit@debbugs.gnu.org; Wed, 05 Nov 2014 15:35:39 -0500 Received: from mail-la0-f48.google.com ([209.85.215.48]:49649) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xm7In-0000mH-Kk for control@debbugs.gnu.org; Wed, 05 Nov 2014 15:35:38 -0500 Received: by mail-la0-f48.google.com with SMTP id gq15so1400221lab.21 for ; Wed, 05 Nov 2014 12:35:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=SOhb0ZN0aDInSQZ1UgL97NYFdSUYFuZM1qqSZT0jDn0=; b=xzwJTcbJTMF4ncMIOOnH+dXDSk35Tw/ha4EM0sEn095BRfRB/as5LRel0/WEi/dTVk u9qKj47j9wD1z+yRIYXQCxxwoAzb3UDysgeRSYIZ2/e/OJV5EeJDfNit+Qs9m0nq7KxZ L86KKPKH2CFTCgw0sPw0p+QJkxITqUOg0F16XYl/mjON5pFhsQVMGk0dS/7CgmuEBBr7 cpgEf5sc3D3i545IWI6YwsQEeb3jWl5qBQV6CRwTFaBFeiqMUJTmL3CNZBGmWmfvtiYJ D5IvlUMeg7lSs1tPVVMyFnmv4S/JssrLHCME6WxRYwxqd6CVCQ47mnkeRkxSd+kK4dRa E8zw== X-Received: by 10.112.202.104 with SMTP id kh8mr8946076lbc.46.1415219736652; Wed, 05 Nov 2014 12:35:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.252.101 with HTTP; Wed, 5 Nov 2014 12:35:16 -0800 (PST) From: Carlos Pita Date: Wed, 5 Nov 2014 17:35:16 -0300 Message-ID: Subject: To: control@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 18796 patch [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (carlosjosepita[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.48 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 2.0 BLANK_SUBJECT Subject is present but empty 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 18796 patch [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.48 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (carlosjosepita[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 2.0 BLANK_SUBJECT Subject is present but empty 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid tags 18796 patch From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 15 16:16:48 2014 Received: (at control) by debbugs.gnu.org; 15 Nov 2014 21:16:48 +0000 Received: from localhost ([127.0.0.1]:34157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xpki8-0002zq-9W for submit@debbugs.gnu.org; Sat, 15 Nov 2014 16:16:48 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:55811) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xpki6-0002zj-Pl for control@debbugs.gnu.org; Sat, 15 Nov 2014 16:16:47 -0500 Received: from [190.246.172.180] (port=39190 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Xpki5-00050u-Th for control@debbugs.gnu.org; Sat, 15 Nov 2014 16:16:46 -0500 From: fgallina@gnu.org (=?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) To: GNU bug tracker automated control server Subject: Date: Sat, 15 Nov 2014 18:16:42 -0300 Message-ID: <877fyw5flx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.0 (---) unmerge 18843 From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 15 16:26:49 2014 Received: (at control) by debbugs.gnu.org; 15 Nov 2014 21:26:49 +0000 Received: from localhost ([127.0.0.1]:34167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xpkro-0003GL-NX for submit@debbugs.gnu.org; Sat, 15 Nov 2014 16:26:49 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:55912) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xpkrm-0003GB-K2 for control@debbugs.gnu.org; Sat, 15 Nov 2014 16:26:47 -0500 Received: from [190.246.172.180] (port=39274 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Xpkrm-0006rK-0c for control@debbugs.gnu.org; Sat, 15 Nov 2014 16:26:46 -0500 From: fgallina@gnu.org (=?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) To: GNU bug tracker automated control server Subject: Date: Sat, 15 Nov 2014 18:26:42 -0300 Message-ID: <87389kyx2l.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.0 (---) merge 18796 18843 unmerge 18432 From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 15 16:33:46 2014 Received: (at control) by debbugs.gnu.org; 15 Nov 2014 21:33:46 +0000 Received: from localhost ([127.0.0.1]:34171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XpkyX-0004lh-RR for submit@debbugs.gnu.org; Sat, 15 Nov 2014 16:33:46 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:56001) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XpkyW-0004lZ-8W for control@debbugs.gnu.org; Sat, 15 Nov 2014 16:33:44 -0500 Received: from [190.246.172.180] (port=39302 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XpkyV-0008Bk-Cz for control@debbugs.gnu.org; Sat, 15 Nov 2014 16:33:43 -0500 From: fgallina@gnu.org (=?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) To: GNU bug tracker automated control server Subject: Date: Sat, 15 Nov 2014 18:33:40 -0300 Message-ID: <877fywno7f.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.0 (---) close 18796 merge 18796 18843 From unknown Mon Jun 23 04:10:18 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, 14 Dec 2014 12:24:04 +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