emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [WIP PATCH] Adding more keybindings to rectangle-mark-mode-map


From: Jim Porter
Subject: Re: [WIP PATCH] Adding more keybindings to rectangle-mark-mode-map
Date: Sat, 1 May 2021 15:31:08 -0700

On Sat, May 1, 2021 at 10:20 AM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
> > Perhaps it makes sense to bind `C-k' in `rectangle-mark-mode'? It
> > seems to be similar to `C-o' and `C-t' in that there are non-rect
> > bindings that already do something different, but they aren't
> > particularly relevant in `rectangle-mark-mode'.
>
> I don't have an opinion on that.

I don't think I have a strong opinion either. I think my confusion
came about as someone who's migrated from using the rect commands in
`C-x r` to using `rectangle-mark-mode'. Someone who isn't already
familiar with the `C-x r' rect commands probably wouldn't expect `C-k'
to kill the current rect. I wouldn't mind writing a patch for this,
but if I'm the only one who got confused this way, a patch might not
be worthwhile.

> >> For `delete-rectangle` we already have `delete-region`
[snip]
> > Interesting, I didn't know that! I'd tried `M-x delete-region' (and
> > Edit -> Clear from the menu bar) and it deleted the whole,
> > non-rectangular region.
[snip]
> Oh, no, you're right: it's not done in `delete-region` (which is
> a fairly low-level function and hence not ideal to piggy-back such
> high-level UI functionality), but in `backward-delete-char-untabify`.
> Whether it kills or deletes (or just does the good old backspace)
> depends on `delete-active-region`.

Perhaps Edit -> Clear should be bound to `backward-delete-char-untabify'?

> There's an argument to be made for making `C-y` replace the region
> when active, as well, indeed.

That's certainly what I'd expect in general, though I hesitated to
suggest it as others may prefer the current behavior, and I'm not
totally confident I'd be able to write a patch that handles all the
corner cases correctly given how widely-used `C-y' is.

- Jim



reply via email to

[Prev in Thread] Current Thread [Next in Thread]