Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d3976e20
Commit
d3976e20
authored
Apr 13, 1994
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Donald Beaudry's change for neater indentation within
parentheses
parent
5333c5d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
Misc/python-mode-old.el
Misc/python-mode-old.el
+15
-6
No files found.
Misc/python-mode-old.el
View file @
d3976e20
;;; Major mode for editing Python programs, version 1.08a
;;; Major mode for editing Python programs, version 1.08a
+
;; by: Tim Peters <tim@ksr.com>
;; after an original idea by: Michael A. Guravage
;;
...
...
@@ -204,6 +204,9 @@ Emacs bell is also rung as a warning.")
(
?\#
.
"<"
)
; hash starts comment
(
?\n
.
">"
))))
; newline ends comment
(
defvar
py-nested-indent
t
"*If non-nil, indent nested continuation lines to inside the opening paren"
)
(
defconst
py-stringlit-re
"'\\([^'\n\\]\\|\\\\.\\)*'"
"regexp matching a Python string literal"
)
...
...
@@ -515,12 +518,18 @@ the new line indented."
(
cond
;; are we on a continuation line?
(
(
py-continuation-line-p
)
(
forward-line
-1
)
(
if
(
py-continuation-line-p
)
; on at least 3rd line in block
(
current-indentation
)
; so just continue the pattern
(
let
((
nest
(
and
py-nested-indent
(
py-nesting-level
))))
(
if
nest
(
save-excursion
(
goto-char
nest
)
(
beginning-of-line
)
(
1+
(
-
nest
(
point
))))
(
forward-line
-1
)
(
if
(
py-continuation-line-p
)
; on at least 3rd line in block
(
current-indentation
)
; so just continue the pattern
;; else on 2nd line in block, so indent more
(
+
(
current-indentation
)
py-indent-offset
py-continuation-offset
)))
(
+
(
current-indentation
)
py-indent-offset
py-continuation-offset
))
)))
;; not on a continuation line
;; if at start of restriction, or on a non-indenting comment line,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment