summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2003-08-01 04:00:32 (GMT)
committerSkip Montanaro <skip@pobox.com>2003-08-01 04:00:32 (GMT)
commit98a4fbe043958cfdbf5199b2d0c1e7cf1f5c9f9a (patch)
tree75868e2fb61e37db02f0c9a444e2737f3b7726c9
parentf37f37dec06cb2f30ce3ba0e6e2ae9b140767b65 (diff)
downloadcpython-98a4fbe043958cfdbf5199b2d0c1e7cf1f5c9f9a.zip
cpython-98a4fbe043958cfdbf5199b2d0c1e7cf1f5c9f9a.tar.gz
cpython-98a4fbe043958cfdbf5199b2d0c1e7cf1f5c9f9a.tar.bz2
make pending-delete/delete-selection mode work with py-electric-colon
-rw-r--r--Misc/python-mode.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index 7a4b7d8..3589e3e 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -1187,14 +1187,14 @@ It is added to `interpreter-mode-alist' and `py-choose-shell'.
(backward-to-indentation 1))
(not (looking-at py-no-outdent-re)))
)))
-
+
(defun py-electric-colon (arg)
"Insert a colon.
In certain cases the line is dedented appropriately. If a numeric
argument ARG is provided, that many colons are inserted
non-electrically. Electric behavior is inhibited inside a string or
comment."
- (interactive "P")
+ (interactive "*P")
(self-insert-command (prefix-numeric-value arg))
;; are we in a string or comment?
(if (save-excursion
@@ -1947,6 +1947,8 @@ number of characters to delete (default is 1)."
(py-electric-backspace arg)))
;; 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 'pending-delete 'supersede) ;pending-del
(put 'py-electric-delete 'delete-selection 'supersede) ;delsel