Commit 41dbc214 authored by Skip Montanaro's avatar Skip Montanaro

make pending-delete/delete-selection mode work with py-electric-colon

parent 2ad3861c
...@@ -1194,7 +1194,7 @@ In certain cases the line is dedented appropriately. If a numeric ...@@ -1194,7 +1194,7 @@ 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment