emacs-devel
[Top][All Lists]
Advanced

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

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


From: Jim Porter
Subject: [WIP PATCH] Adding more keybindings to rectangle-mark-mode-map
Date: Fri, 30 Apr 2021 22:23:48 -0700

One thing that always trips me up about the otherwise very nice
`rectangle-mark-mode-map' is that it only has a few key mappings, and
is notably missing `kill-rectangle' and `copy-rectangle-as-kill'. The
attached patch adds these (remapped from `kill-region' and
`kill-ring-save'), but there are still several other rectangle
commands in the `C-x r' prefix that might be worth adding, so I
figured I'd see what others thought:

  C-x r N         rectangle-number-lines
  C-x r c         clear-rectangle
  C-x r d         delete-rectangle
  C-x r r         copy-rectangle-to-register

As far as I'm aware, none of these have non-rect analogues that we
could remap except for `C-x r r', which is similar to `C-x r s'
(`copy-to-register'). Perhaps it makes sense to map these as well, but
I don't typically use any of them so I'm not sure what would be good
mappings. At a guess though, maybe these would work?

  M-N (M-S-n)     rectangle-number-lines
  M-SPC           clear-rectangle
  C-d             delete-rectangle
  C-x r s         copy-rectangle-to-register

Finally, there's `C-x r y' (`yank-rectangle'). As I understand it at
least, this doesn't need/want an active rect so there's no real reason
to map it in `rectangle-mark-mode-map'. However, when I was learning
about rects, I always *expected* `yank-rectangle' to require me to
have an active rect. Maybe it makes sense to do something about that,
or maybe not; that's just my anecdotal experience.

- Jim

Attachment: 0001-lisp-rect.el-rectangle-mark-mode-map-Add-kill-rectan.patch
Description: Binary data


reply via email to

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