Subject: bug#48695: python.el *-backspace functionality behavior

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 28 May 2021 03:13:21 +0200

(Please keep the debbugs address in the Cc headers -- otherwise your
mails won't reach the Emacs bug tracker.)

Mikhail P <[email-masked]> writes:

> Greetings!
>
> The steps are :
>
> 1. start emacs with emacs -Q
>
> 2. visit a (empty) file with .py extension (so built-in Python major mode is activated)
>
> 3. type a block of code containing indented line, e.g. 
>
> for i in range(10): 
>
>     print(i)
>
> 4. Move the cursor at the very end of the code example (after print(i)) and activate
> the mark
>
> 5. Move the cursor at the beginning of print(i), so it is on p.
>
> 6. hit backspace.
>
> 7. selected text (print(i)) is not deleted but dedented instead)

Thanks for the recipe -- I can reproduce this in both Emacs 28 and 27.1.

If point is anywhere else than at the "p", the <backspace> works as
expected, but if it's a the "p", it deletes the leading spaces instead.
Most peculiar.