diff options
author | Barry Warsaw <barry@python.org> | 1995-03-14 23:59:07 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1995-03-14 23:59:07 (GMT) |
commit | 9b623b3d6329425daa4cb389546eb23a32354b52 (patch) | |
tree | 83791ff5037cd015e21baf96a27ec4a7934db06d /Misc | |
parent | 464c94af2a0c9a22f205a164d6a58734c0f427a7 (diff) | |
download | cpython-9b623b3d6329425daa4cb389546eb23a32354b52.zip cpython-9b623b3d6329425daa4cb389546eb23a32354b52.tar.gz cpython-9b623b3d6329425daa4cb389546eb23a32354b52.tar.bz2 |
(py-electric-colon): don't re-indent the line if it starts in column
zero
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/python-mode.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el index ffe9850..ec2b5cb 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 |