]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
(py-electric-colon): don't indent, only outdent.
authorBarry Warsaw <barry@python.org>
Wed, 15 Mar 1995 18:19:15 +0000 (18:19 +0000)
committerBarry Warsaw <barry@python.org>
Wed, 15 Mar 1995 18:19:15 +0000 (18:19 +0000)
Misc/python-mode.el

index be08e0018d52f86dff7ba971e8528792e93faadc..15c62a69daf00fff6a71bbae32f48bbd1193aa60 100644 (file)
@@ -436,10 +436,12 @@ argument is provided, that many colons are inserted non-electrically."
                           (py-compute-indentation)))
               )
          (setq outdent py-indent-offset))
-      ;; 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
+      ;; electric colon won't re-indent lines that start to the left
+      ;; of the current computed indentation, under the assumption
+      ;; that these are already outdented properly.  Use TAB, C-c C-l
+      ;; or C-c C-r to adjust.  TBD: Is there a better way to
+      ;; determine this???
+      (if (< (current-indentation) indent) nil
        (goto-char here)
        (beginning-of-line)
        (delete-horizontal-space)