Mercurial > cpython-lru_cache-weakref
diff Misc/python-mode.el @ 18150:9ce8a995bf12 legacy-trunk
(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.
| author | Barry Warsaw <barry@python.org> |
|---|---|
| date | Mon, 18 Jun 2001 23:40:35 +0000 |
| parents | f3f9641743a0 |
| children | 0ec03e1be558 |
line wrap: on
line diff
--- a/Misc/python-mode.el Mon Jun 18 22:27:39 2001 +0000 +++ b/Misc/python-mode.el Mon Jun 18 23:40:35 2001 +0000 @@ -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 @@ :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 @@ ;; 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 @@ (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))
