Mercurial > cpython-lru_cache-weakref
diff Misc/python-mode.el @ 30033:7058dcf733d4 legacy-trunk
make pending-delete/delete-selection mode work with py-electric-colon
| author | Skip Montanaro <skip@pobox.com> |
|---|---|
| date | Fri, 01 Aug 2003 04:00:32 +0000 |
| parents | d72547c915d5 |
| children | 43c9771e0be1 |
line wrap: on
line diff
--- a/Misc/python-mode.el Thu Jul 31 10:35:29 2003 +0000 +++ b/Misc/python-mode.el Fri Aug 01 04:00:32 2003 +0000 @@ -1187,14 +1187,14 @@ (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 @@ (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
