An Emacs mode for editing Python code

Backspace deletes spaces not tabs

Reported by Noah on 2012-07-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Undecided
Unassigned

Bug Description

I know it's called backspace, but I'd like it to remove a full tab if I'm at the end of a line with only whitespace. 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'm running the terminal in MacOS X 10.6.8, with emacs 24.1.1.

Changed in python-mode:
milestone: none → 6.0.11
assignee: nobody → Andreas Roehler (a-roehler)
importance: Undecided → Medium

Am 20.07.2012 16:28, schrieb Noah:
> Public bug reported:
>
> I know it's called backspace, but I'd like it to remove a full tab if
> I'm at the end of a line with only whitespace. 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>
>

that's an Emacs service: if a command is bound to a key, but is invoked by more laborious M-x COMMAND
Emacs will remind you of the easier way to call

Backspace will perform py-electric-backspace in python-mode

> 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'm
> running the terminal in MacOS X 10.6.8, with emacs 24.1.1.
>

thanks using current python-mode.el

Please send some code example, which triggers the bug for you.
Can't reproduce it.

With py-electric-backspace tabs and spaces are deleted here likewise.

Andreas

Changed in python-mode:
status: New → Incomplete
Noah (nspies) wrote :

Apparently delete, forward delete and backspace are three different keys in Linux (?). My backspace key seems to be sending DEL rather than backspace, and I've managed to bind DEL to py-electric-backspace in python-mode. My setup (older python-mode) on a different computer worked fine so I assume that binding has since disappeared, but I can't rule out some other difference between the setups.

When I get a chance, I'll try out the old python-mode on the newer computer to see if it's in python-mode or somewhere else. My emacs-fu is limited, but here's the fix I'm using for now:

(add-hook 'python-mode-hook
     (lambda () (define-key python-mode-map (kbd "DEL") 'py-electric-backspace)))

Am 22.07.2012 22:00, schrieb Noah:
> Apparently delete, forward delete and backspace are three different keys
> in Linux (?). My backspace key seems to be sending DEL rather than
> backspace, and I've managed to bind DEL to py-electric-backspace in
> python-mode. My setup (older python-mode) on a different computer worked
> fine so I assume that binding has since disappeared, but I can't rule
> out some other difference between the setups.
>
> When I get a chance, I'll try out the old python-mode on the newer
> computer to see if it's in python-mode or somewhere else. My emacs-fu is
> limited, but here's the fix I'm using for now:
>
> (add-hook 'python-mode-hook
> (lambda () (define-key python-mode-map (kbd "DEL") 'py-electric-backspace)))
>

Maybe we should consider system-type here?
The output of M-x emacs-version might be of some interest.

Changed in python-mode:
importance: Medium → Undecided
assignee: Andreas Roehler (a-roehler) → nobody
Launchpad Janitor (janitor) wrote :

[Expired for python-mode.el because there has been no activity for 60 days.]

Changed in python-mode:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions