Subject: bug#78262: 30.1; comint-delchar-or-maybe-eof doesn't respect delete-active-region

From: Juri Linkov <[email-masked]>
Date: Mon, 12 May 2025 20:46:35 +0300

>>>> PS: this still requires
>>>>
>>>>   (put 'comint-delchar-or-maybe-eof 'delete-selection 'supersede)
>>>>
>>>> that could be added later.
>>>
>>> Hmm... sorry my `delete-selection`-fu is rusty, what would this
>>> do/fix, again?
>>
>> This is a copy from delsel.el
>>
>>   ;; delete-backward-char and delete-forward-char already delete the selection by
>>   ;; default, but not delete-char.
>>   (put 'delete-char 'delete-selection 'supersede)
>>
>> that will do the same for 'comint-delchar-or-maybe-eof'
>> that uses 'delete-char' by default.
>
> Ah.  I consider this part of delsel.el to be obsolete (made obsolete
> back in Emacs-24 by the `delete-active-region` variable).

It seems the primary reason people are rebinding `C-d` from `delete-char`
to `delete-forward-char` is to be able to delete the region with it.

> If `delsel.el` wants to make `C-d` delete the active region, it should
> preferably do it by remapping `delete-char` to `delete-forward-char`, IMO.

Not sure if `delsel.el` should rebind the global keybindings.

Anyway, your latest patch is sufficient for closing this bug report.