summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-06-18 23:40:35 (GMT)
committerBarry Warsaw <barry@python.org>2001-06-18 23:40:35 (GMT)
commitfd4c9e87a79b917750d153a7330495b777358aa3 (patch)
treeae89aa2920f4b8e8e66f607d115bca8852bbcbdf
parent3eec38af37d4593a6ce7a406de3b20d6c2b322f2 (diff)
downloadcpython-fd4c9e87a79b917750d153a7330495b777358aa3.zip
cpython-fd4c9e87a79b917750d153a7330495b777358aa3.tar.gz
cpython-fd4c9e87a79b917750d153a7330495b777358aa3.tar.bz2
(py-continuation-offset): New variable which controls how much to
indent continuation lines, defined as lines following those that end in backslash. (py-compute-indentation): Support for py-continuation-offset.
-rw-r--r--Misc/python-mode.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index 38a8659..30d733b 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.1"
"`python-mode' version number.")
;; This software is provided as-is, without express or implied
@@ -123,6 +123,13 @@ you're editing someone else's Python code."
:type 'integer
:group 'python)
+(defcustom py-continuation-offset 4
+ "*Additional amount of offset to give for continuation lines.
+Continuation lines are those that immediately follow a backslash
+terminated line."
+ :type 'integer
+ :group 'python)
+
(defcustom py-smart-indentation t
"*Should `python-mode' try to automagically set some indentation variables?
When this variable is non-nil, two things happen when a buffer is set
@@ -1800,7 +1807,8 @@ dedenting."
;; chunk of non-whitespace characters on base line, + 1 more
;; column
(end-of-line)
- (setq endpos (point) searching t)
+ (setq endpos (point)
+ searching t)
(back-to-indentation)
(setq startpos (point))
;; look at all "=" from left to right, stopping at first
@@ -1825,7 +1833,8 @@ dedenting."
(progn
(goto-char startpos)
(skip-chars-forward "^ \t\n")))
- (1+ (current-column))))))
+ (+ (current-column) py-continuation-offset 1)
+ ))))
;; not on a continuation line
((bobp) (current-indentation))