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
41dbc214
Commit
41dbc214
authored
Aug 01, 2003
by
Skip Montanaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make pending-delete/delete-selection mode work with py-electric-colon
parent
2ad3861c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Misc/python-mode.el
Misc/python-mode.el
+4
-2
No files found.
Misc/python-mode.el
View file @
41dbc214
...
@@ -1187,14 +1187,14 @@ It is added to `interpreter-mode-alist' and `py-choose-shell'.
...
@@ -1187,14 +1187,14 @@ It is added to `interpreter-mode-alist' and `py-choose-shell'.
(
backward-to-indentation
1
))
(
backward-to-indentation
1
))
(
not
(
looking-at
py-no-outdent-re
)))
(
not
(
looking-at
py-no-outdent-re
)))
)))
)))
(
defun
py-electric-colon
(
arg
)
(
defun
py-electric-colon
(
arg
)
"Insert a colon.
"Insert a colon.
In certain cases the line is dedented appropriately. If a numeric
In certain cases the line is dedented appropriately. If a numeric
argument ARG is provided, that many colons are inserted
argument ARG is provided, that many colons are inserted
non-electrically. Electric behavior is inhibited inside a string or
non-electrically. Electric behavior is inhibited inside a string or
comment."
comment."
(
interactive
"P"
)
(
interactive
"
*
P"
)
(
self-insert-command
(
prefix-numeric-value
arg
))
(
self-insert-command
(
prefix-numeric-value
arg
))
;; are we in a string or comment?
;; are we in a string or comment?
(
if
(
save-excursion
(
if
(
save-excursion
...
@@ -1947,6 +1947,8 @@ number of characters to delete (default is 1)."
...
@@ -1947,6 +1947,8 @@ number of characters to delete (default is 1)."
(
py-electric-backspace
arg
)))
(
py-electric-backspace
arg
)))
;; required for pending-del and delsel modes
;; required for pending-del and delsel modes
(
put
'py-electric-colon
'delete-selection
t
)
;delsel
(
put
'py-electric-colon
'pending-delete
t
)
;pending-del
(
put
'py-electric-backspace
'delete-selection
'supersede
)
;delsel
(
put
'py-electric-backspace
'delete-selection
'supersede
)
;delsel
(
put
'py-electric-backspace
'pending-delete
'supersede
)
;pending-del
(
put
'py-electric-backspace
'pending-delete
'supersede
)
;pending-del
(
put
'py-electric-delete
'delete-selection
'supersede
)
;delsel
(
put
'py-electric-delete
'delete-selection
'supersede
)
;delsel
...
...
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