From: Barry Warsaw Date: Tue, 14 Mar 1995 23:59:07 +0000 (+0000) Subject: (py-electric-colon): don't re-indent the line if it starts in column X-Git-Tag: v1.2b4~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9b623b3d6329425daa4cb389546eb23a32354b52;p=thirdparty%2FPython%2Fcpython.git (py-electric-colon): don't re-indent the line if it starts in column zero --- diff --git a/Misc/python-mode.el b/Misc/python-mode.el index ffe98503f49d..ec2b5cb321b8 100644 --- a/Misc/python-mode.el +++ b/Misc/python-mode.el @@ -433,11 +433,15 @@ argument is provided, that many colons are inserted non-electrically." (py-compute-indentation))) ) (setq outdent py-indent-offset)) - (goto-char here) - (beginning-of-line) - (delete-horizontal-space) - (indent-to (- indent outdent)) - ))) + ;; electric colon won't re-indent lines that start in column + ;; zero. you'd have to use TAB for that. TBD: Is there a + ;; better way to determine this??? + (if (zerop (current-indentation)) nil + (goto-char here) + (beginning-of-line) + (delete-horizontal-space) + (indent-to (- indent outdent)) + )))) ;;; Functions that execute Python commands in a subprocess