From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [WIP PATCH] Adding more keybindings to rectangle-mark-mode-map Date: Sat, 01 May 2021 13:20:06 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26493"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Jim Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 01 19:22:02 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 1lctJa-0006nA-57 for ged-emacs-devel@m.gmane-mx.org; Sat, 01 May 2021 19:22:02 +0200 Original-Received: from localhost ([::1]:42554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lctJZ-0002co-7R for ged-emacs-devel@m.gmane-mx.org; Sat, 01 May 2021 13:22:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lctHs-0001M3-1t for emacs-devel@gnu.org; Sat, 01 May 2021 13:20:16 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:35070) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lctHp-00039D-Iq for emacs-devel@gnu.org; Sat, 01 May 2021 13:20:15 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 45C8080564; Sat, 1 May 2021 13:20:10 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DE9A080420; Sat, 1 May 2021 13:20:08 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1619889608; bh=GRDxGkdiSPR9LfoGdx0+zK/Dg7QmvXW98PtQ6dI3u30=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=m8ZYgSjnohJlrWR1y1OdxoTMjl9fBZ+U+SMXg6qdvz9pd0AYBRYuiqx9bnzdQC4n6 o7V7S4sn6q75hCH6R5ijIGi7baFlqqf5ZLRl8No4pMHJicxpvKhR13eorNPcL3gzhU 0fSwHDEUP6Mx6I5YZK0JYvKl/V2VtCcu1FTjMyTpBRMu6YtN5y+7bIum1BzfKTUZC7 rjgTHp8/gNgpLyUOd86fx//s96TTRGJWxDydjMM0cNFmNz+l4YuHHHHkyaMiCviq/t NyRusApTiV6O/DEeR7Ijnou1lZRVAv5Ne7yJ0QABjpTscCrcG8M5orQEBygody8v9p XRe91xdkHJ4MA== Original-Received: from alfajor (unknown [108.161.125.61]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B41B7120263; Sat, 1 May 2021 13:20:08 -0400 (EDT) In-Reply-To: (Jim Porter's message of "Sat, 1 May 2021 09:02:51 -0700") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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:268723 Archived-At: > 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. >> > C-x r d delete-rectangle >> >> For `delete-rectangle` we already have `delete-region`, and it operates >> on the rectangle when `rectangle-mark-mode` is active. >> It is not bound by default, but DEL (aka `backspace`) does delegate to >> it by default when the region is active. > > 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. Perhaps that's just a bug, since `M-x > kill-region' operates on the rect correctly. 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`. >> This said, I do think the way yanking rectangles works currently is not >> fully satisfactory, because it's not always clear/intuitive how where >> the rectangle will get inserted. So maybe we do need a special yank >> command active during `rectangle-mark-mode` which replaces the selected >> rectangle with the yanked one, or something like that. > > I agree. Once I tinkered with yanking rectangles a bit, it (mostly) > made sense to me, but instinctively, I wanted to select the rect to > yank into first. That works as you'd expect when the point is at the > beginning of the rect but not when it's at the end. I'm not sure what > I'd want to change though, since it works the same as yanking when you > have a non-rectangular region selected too. There's an argument to be made for making `C-y` replace the region when active, as well, indeed. Stefan