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: Re: [WIP PATCH] Adding more keybindings to rectangle-mark-mode-map Date: Sun, 2 May 2021 21:06:18 -0700 Message-ID: References: <83czu98vws.fsf@gnu.org> <83lf8x6rtv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000018f0f05c1651640" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23806"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 03 06:07:43 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 1ldPrx-00064o-ON for ged-emacs-devel@m.gmane-mx.org; Mon, 03 May 2021 06:07:41 +0200 Original-Received: from localhost ([::1]:33596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldPrw-0002N3-SL for ged-emacs-devel@m.gmane-mx.org; Mon, 03 May 2021 00:07:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldPqr-0001VV-TX for emacs-devel@gnu.org; Mon, 03 May 2021 00:06:34 -0400 Original-Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:35531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldPqq-0003Zf-4G; Mon, 03 May 2021 00:06:33 -0400 Original-Received: by mail-pj1-x102b.google.com with SMTP id h14-20020a17090aea8eb02901553e1cc649so5024954pjz.0; Sun, 02 May 2021 21:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ltgnYdfvPJeEBtIHug+SyRzGPX7n4qaLbm9yVUjanoE=; b=mm0p0CzOxxQSFz/NQv+8RwhK/FLe95mBgyDWiNpOwE/vBStGnZeWAgKsSxUYC6BALY 6/ab8O6Wyo88fJ/c8e6P6qE0HCRJkfhO+NKi8qTBercrdAyNAs5a5RbXl9FqOP5PS0pX 0Vw1o1oT0bN5OX+7LZECZ77HOBhNPfRnpP4qEivnXFFDu/UCtzVUNA33xakBlUnvTyKd CEPgbNfIH8LjSB8FgvBhR8A2r7uN2Y22jJBeDx+JlQpscFYJ9bADGE2LxP+EqO55crDY McTMiDcSPclFJ04Sy2MRAOnzf5b8WHEXX0XUHeDfihlSCG9A7hDSTfctjuJHL0J+uw5C NRww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ltgnYdfvPJeEBtIHug+SyRzGPX7n4qaLbm9yVUjanoE=; b=PlHvH422PtL+flZVKwXskwaWwf/70j5M2hRjM8U2O3U8dq6G1w5Swew5RdwzCmErzC xgRtwZYIzoklMxjR5HgazL2wbNMQ8dGzZEQ4NCfjYoqX3Jg7MHz2YEisFpH6AfyrT8Cx li46Txc+xZ1CObfXa2Eq2GDTjJS7kgcCNmB+cCqFRRvOWoB3d21RqDCEF1K14hfJGQv6 5kr34XhxXTJAvdMdh2dkJHWO7krPc6Yam9gRBkAt39YPyTcg8doDnqZy8jtd9/GbF8R8 OfiSq2xnnqMVHPrG8NNdMBI6VeDCNujHDsXXaKcWurXdBaNIKW1reUcoo1wXVZypt6VO 6w4A== X-Gm-Message-State: AOAM531ksONzF6JvX/jMTXY7FCniXdrbeEoBMY7AHciTGfn0Y+tAqBlc LjpGQJds9eBvw0OHI/s5r/CCW3NAwlLP7i1wK+dvRj8N X-Google-Smtp-Source: ABdhPJwQIZwx7IGq6Y6tvAwPe4XFFmxo7hjYB4XqA1wj4I67aN1L88q+LOr+Wd/BYQhlcBxnSbqcJkZxXxEitHoSKHo= X-Received: by 2002:a17:90b:19cc:: with SMTP id nm12mr18572198pjb.169.1620014788604; Sun, 02 May 2021 21:06:28 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=jporterbugs@gmail.com; helo=mail-pj1-x102b.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:268796 Archived-At: --000000000000018f0f05c1651640 Content-Type: text/plain; charset="UTF-8" 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 --000000000000018f0f05c1651640 Content-Type: application/octet-stream; name="0001-Ensure-menu-bar-edit-clear-handles-rectangular-regio.patch" Content-Disposition: attachment; filename="0001-Ensure-menu-bar-edit-clear-handles-rectangular-regio.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ko82xteb0 RnJvbSBlMGQ1OWMyYjIxMGZjZWIwM2I1ZmM4ZGY4NDAzMTc5ZmJhOWJlODQ1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5jb20+CkRh dGU6IFN1biwgMiBNYXkgMjAyMSAyMDo1ODowMCAtMDcwMApTdWJqZWN0OiBbUEFUQ0hdIEVuc3Vy ZSBgPG1lbnUtYmFyPiA8ZWRpdD4gPGNsZWFyPicgaGFuZGxlcyByZWN0YW5ndWxhcgogcmVnaW9u cwoKKiBsaXNwL2RlbHNlbC5lbCAoZGVsZXRlLWFjdGl2ZS1yZWdpb24pOiBBdXRvbG9hZCBpdCBh bmQgbWFrZSBpdCBpbnRlcmFjdGl2ZS4KKiBsaXNwL21lbnUtYmFyLmVsIChtZW51LWJhci1lZGl0 LW1lbnUpOiBCaW5kICJDbGVhciIgdG8KYGRlbGV0ZS1hY3RpdmUtcmVnaW9uJy4KLS0tCiBsaXNw L2RlbHNlbC5lbCAgIHwgMiArKwogbGlzcC9tZW51LWJhci5lbCB8IDIgKy0KIDIgZmlsZXMgY2hh bmdlZCwgMyBpbnNlcnRpb25zKCspLCAxIGRlbGV0aW9uKC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC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dCi0gICAgICAnKG1lbnUtaXRlbSAiQ2xlYXIiIGRlbGV0ZS1yZWdpb24KKyAg ICAgICcobWVudS1pdGVtICJDbGVhciIgZGVsZXRlLWFjdGl2ZS1yZWdpb24KICAgICAgICAgICAg ICAgICAgIDplbmFibGUgKGFuZCBtYXJrLWFjdGl2ZQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChub3QgYnVmZmVyLXJlYWQtb25seSkpCiAgICAgICAgICAgICAgICAgICA6aGVscAot LSAKMi4yNS4xCgo= --000000000000018f0f05c1651640--