From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: [WIP PATCH] Adding more keybindings to rectangle-mark-mode-map Date: Fri, 30 Apr 2021 22:23:48 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000071b32605c13def3c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20979"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 01 07:24:41 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lci7M-0005MH-Lv for ged-emacs-devel@m.gmane-mx.org; Sat, 01 May 2021 07:24:40 +0200 Original-Received: from localhost ([::1]:43562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lci7L-00036E-Pw for ged-emacs-devel@m.gmane-mx.org; Sat, 01 May 2021 01:24:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lci6k-0002eH-D0 for emacs-devel@gnu.org; Sat, 01 May 2021 01:24:02 -0400 Original-Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:40780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lci6h-0004Po-Jf for emacs-devel@gnu.org; Sat, 01 May 2021 01:24:02 -0400 Original-Received: by mail-pl1-x62a.google.com with SMTP id n16so2385plf.7 for ; Fri, 30 Apr 2021 22:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=VGttG9HY67z8wFqunXA2nz7TjYA4U9RWgrHUjTmu9TU=; b=fT/2HIqrMuYdRlNNIKb9k0fmrq+3Qf790+DoSbeUbOQ321qKWjI0S6MfBndLGxHGZB VQM+qL3I766mHYR78R5UcL5c7Y1MYmilV1ln4MXRN0UMqiGU6ExJe17rfdCX4iSU7OhY KNIYCTAZE3Wsc/CZxwilaQM1tH9TDPyGmtU11ABeldvHX3fb7tFuaNAAp3qwn+QejRY7 2NKbrn7mWPNsx0Up2GOiOlNV41jmYWp4H0vQ54k91ZYuEKVuWMcRTarsHsJ2nN9CYo+G wlsD7CD8vxPRZn5BAq/YQ3by9xsQluau6KadU94Feb/3OpoCHTBjITccQwSmuFaTkVwC nyUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=VGttG9HY67z8wFqunXA2nz7TjYA4U9RWgrHUjTmu9TU=; b=cWwUOikBj080lYCRAPKvRqSEYqX4uDyR8i+fA88O3L+HgRDl5UjRnZbDWZY4p1oVnw W0KCkuhgUmGbfZ044HN6DGwktdN++RHNeNWMhf/L4NsdVBpdeXUtB+P0Il5jIpZDUbjy 4d+mUVL/hDIIxthqxJOY6jVmj19sLUeikHesKGyoaxUNRNjc2LNaGmMktO1Zav01+w/b DH7BDNwqq8v+PsyeWCX41YsApBE+0jZCLOKcRCrnibC2tZYY+xb0oRSb6csiuKvgp9Q8 /IJSq5NwjITulv6LWPa+gf4y1HgqM29Z83Gb6Pl6cU3dabpMoCcpSY9Dwg+wmZ98s2zP fvCw== X-Gm-Message-State: AOAM531ApHADYvSqbh4vSoW//PjstbNqKnq2Vuz/X9uUjn4nvuUPMPJI GHZUGyQEHmJcB5eZal3GK/8hEs1DhIxcIDbUjyVMbr9a7tM= X-Google-Smtp-Source: ABdhPJz+Buz11t6v/55jxMpopcfL5239tj5Na+6WmeWJvqUL89fP39ofcPGoQ8qVKZarQuSXhPMxnA4nzK3nOL1HCm8= X-Received: by 2002:a17:90b:19cc:: with SMTP id nm12mr8691630pjb.169.1619846637919; Fri, 30 Apr 2021 22:23:57 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=jporterbugs@gmail.com; helo=mail-pl1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:268702 Archived-At: --00000000000071b32605c13def3c Content-Type: text/plain; charset="UTF-8" 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 --00000000000071b32605c13def3c Content-Type: application/octet-stream; name="0001-lisp-rect.el-rectangle-mark-mode-map-Add-kill-rectan.patch" Content-Disposition: attachment; filename="0001-lisp-rect.el-rectangle-mark-mode-map-Add-kill-rectan.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ko5aln3l0 RnJvbSBkMTBjZjFkYzdmNDU5NTg4YTkwNTEzNGY4NGI3NmM2OTQ4ZjNjYWNlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5jb20+CkRh dGU6IEZyaSwgMzAgQXByIDIwMjEgMjE6NDc6MjkgLTA3MDAKU3ViamVjdDogW1BBVENIXSAqIGxp c3AvcmVjdC5lbCAocmVjdGFuZ2xlLW1hcmstbW9kZS1tYXApOiBBZGQKIGBraWxsLXJlY3Rhbmds ZScgYW5kIGBjb3B5LXJlY3RhbmdsZS1hcy1raWxsJyB0byBtYXAKCi0tLQogbGlzcC9yZWN0LmVs IHwgMiArKwogMSBmaWxlIGNoYW5nZWQsIDIgaW5zZXJ0aW9ucygrKQoKZGlmZiAtLWdpdCBhL2xp c3AvcmVjdC5lbCBiL2xpc3AvcmVjdC5lbAppbmRleCA1MDRiZTQxYjY3Li5iYWU5MTQyMTI5IDEw MDY0NAotLS0gYS9saXNwL3JlY3QuZWwKKysrIGIvbGlzcC9yZWN0LmVsCkBAIC02MzgsNiArNjM4 LDggQEAgd2l0aCBhIHByZWZpeCBhcmd1bWVudCwgcHJvbXB0IGZvciBTVEFSVC1BVCBhbmQgRk9S TUFULiIKICAgKGxldCAoKG1hcC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