I'm having trouble getting the py-electric-backspace
command to execute when I hit backspace at the end of a line of only spaces in python-mode. When I hit backspace it deletes individual spaces, not 4 at a time as it should be.
What confuses me is that if I do M-x py-electric-backspace
, it performs the command correctly and tells me I could have invoked the command by using backspace:
You can run the command `py-electric-backspace' with <backspace>
I'm using python-mode.el version 6.0.10, and I've tried reducing my .emacs file to only the few lines required to load python-mode.el.
I'd like backspace to work properly in python-mode, but I don't even know where to start figuring out what's wrong. Any help would be appreciated.
Update:
I've added the following to my .emacs file:
(add-hook 'python-mode-hook
(lambda () (define-key python-mode-map (kbd "DEL") 'py-electric-backspace)))
which seems to do the trick.