Subject: Re: bug#75042: `backward-delete-char-untabify': active-region behavior

From: Eli Zaretskii <[email-masked]>
Date: Sun, 13 Apr 2025 11:27:12 +0300

> From: Asher Copeland <[email-masked]>
> Date: Wed, 02 Apr 2025 10:59:04 -0700
> 
> I have attached to this e-mail a patch that I believe fixes the bug, by
> adding a condition that checks for the same conditions that
> `delete-backward-char' uses for the same behavior, and delegates to
> `delete-backward-char' if the conditions are met.
> 
> I have also found that the bug has another aspect, also fixed by the
> patch. I will describe the steps for reproducing it below:
> 
>  1) emacs -Q
>  2) C-q TAB w o r d
>  3) C-SPC M-b
>  4) Execute `backward-delete-char-untabify' (bound to DEL)
> 
> Notice that "word" was deleted, which is expected, but that the literal
> TAB character was untabified, even though it was not necessary to do so.
> 
> The expected behavior is to delete "word" without untabifying.
> 
> I've looked at my previous e-mail and realized that I didn't leave clear
> steps for reproduction for that aspect of the bug, so I will do so here:
> 
>  1) emacs -Q
>  2) M-: (setq backward-delete-char-untabify-method 'hungry)
>  3) SPC SPC w o r d
>  4) C-SPC M-b
>  5) Execute `backward-delete-char-untabify' (bound to DEL)
> 
> The expected behavior for it to delete "word", but instead it deletes
> the two spaces to the left of point.
> 
> This patch fixes both issues with a single branch that makes it act like
> `delete-backward-char' when it is appropriate to kill the region.

Thanks, installed on the master branch, and closing the bug.