On Sun, May 2, 2021 at 11:07 AM Stefan Monnier wrote: > > Jim Porter [2021-05-02 09:36:14] wrote: > > On Sun, May 2, 2021 at 9:09 AM Eli Zaretskii wrote: > >> > From: Jim Porter > >> > I interpreted that to mean that, if Edit -> Clear is only enabled > >> > when there's an active region/rect, `backward-delete-char-untabify' > >> > is equivalent to a hypothetical `delete-rect-or-region'. > >> > >> But Edit->Clear is enabled even when the region is not active, like if > >> you turn off transient-mark-mode. > > > > Ah. In that case, a new function might be safer. > > Indeed, we need a new function here. > It should be a small matter of moving the code from > `backward-delete-char-untabify' into a separate function. For what it's worth, I think the attached patch fixes this by changing the binding for Edit -> Clear to `delete-active-region'. I've tested it out with and without `transient-mark-mode' using regular and rectangular regions and it seems to work correctly. I never turn off `transient-mark-mode' in my normal usage though, so I may have missed some corner cases. - Jim