]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
(py-electric-colon): don't re-indent the line if it starts in column
authorBarry Warsaw <barry@python.org>
Tue, 14 Mar 1995 23:59:07 +0000 (23:59 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 14 Mar 1995 23:59:07 +0000 (23:59 +0000)
zero

Misc/python-mode.el

index ffe98503f49d1bbbaa4fdd13882e7243970e3885..ec2b5cb321b835a3e75215658db858ef7e2cf550 100644 (file)
@@ -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))
+       ))))
 
 \f
 ;;; Functions that execute Python commands in a subprocess