summaryrefslogtreecommitdiffstats
path: root/Misc/python-mode.el
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-07-06 20:07:13 (GMT)
committerBarry Warsaw <barry@python.org>2001-07-06 20:07:13 (GMT)
commit40fb452be954ca7c1ac66ea8374027f50c09e961 (patch)
treeb6f34f0f28c25b724b8c654797cf1e521786577c /Misc/python-mode.el
parent91f2f26d7515635453945325fb833bde13396f4c (diff)
downloadcpython-40fb452be954ca7c1ac66ea8374027f50c09e961.zip
cpython-40fb452be954ca7c1ac66ea8374027f50c09e961.tar.gz
cpython-40fb452be954ca7c1ac66ea8374027f50c09e961.tar.bz2
(py-continuation-offset): Update docstring to describe that this
additional offset is only applied to continuation lines for block opening statements. (py-compute-indentation): Only add py-continuation-offset if py-statement-opens-block-p is true.
Diffstat (limited to 'Misc/python-mode.el')
-rw-r--r--Misc/python-mode.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index 6ee2bab..4837910 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -8,7 +8,7 @@
;; Created: Feb 1992
;; Keywords: python languages oop
-(defconst py-version "$Revision$"
+(defconst py-version "4.3"
"`python-mode' version number.")
;; This software is provided as-is, without express or implied
@@ -124,9 +124,10 @@ you're editing someone else's Python code."
:group 'python)
(defcustom py-continuation-offset 4
- "*Additional amount of offset to give for continuation lines.
+ "*Additional amount of offset to give for some continuation lines.
Continuation lines are those that immediately follow a backslash
-terminated line."
+terminated line. Only those continuation lines for a block opening
+statement are given this extra offset."
:type 'integer
:group 'python)
@@ -1833,7 +1834,11 @@ dedenting."
(progn
(goto-char startpos)
(skip-chars-forward "^ \t\n")))
- (+ (current-column) py-continuation-offset 1)
+ ;; if this is a continuation for a block opening
+ ;; statement, add some extra offset.
+ (+ (current-column) (if (py-statement-opens-block-p)
+ py-continuation-offset 0)
+ 1)
))))
;; not on a continuation line