From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#73284: [PATCH] Add option to push mark after delete-pair Date: Tue, 17 Sep 2024 09:56:00 +0300 Organization: LINKOV.NET Message-ID: <868qvq23e7.fsf@mail.linkov.net> References: <86setzddrp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26706"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: 73284@debbugs.gnu.org, Paul Nelson To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 17 08:58:13 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sqSA8-0006pk-EH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Sep 2024 08:58:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqS9p-0002AE-FN; Tue, 17 Sep 2024 02:57:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqS9k-0002A3-5a for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 02:57:48 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sqS9j-0003CV-Sa for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 02:57:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=wugy438VBmlZUTZWy9Pjm6n8fF/Sek2wT9TgJ6ZdEbw=; b=Ff/3uyCwjKyWW4yM/F3j5QEjakGsBQTCo+z1BftYAKeE5FfFAbndhNJ75QSX8z1K397mHqfMMKJexh7eEVYFOr1Hh/tHn9IHEl4DC/agnLBZXtuoMoQBL+K7I8j9vBtzMoDKISsqiimvWO8h6V01aRT4W632eH4+IQR+61LY1kjzz8IMq27qh+sICVV0COwpXctC1f2Iwh96JqYogz9hg6OC9ciHlJIXWH4hvEgDbC2D0PfVs+f+p2w8XKsmwHEn+QsVwPTOD20oDRzsR9eacvX5Iz+LLDAJj9+CYKILFreoMrzxIfWQaEr3V8qMIwt7j3xK+ugLzEA62+ES3jaBbg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sqS9y-00080j-4Z for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 02:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Sep 2024 06:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73284 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73284-submit@debbugs.gnu.org id=B73284.172655625930757 (code B ref 73284); Tue, 17 Sep 2024 06:58:02 +0000 Original-Received: (at 73284) by debbugs.gnu.org; 17 Sep 2024 06:57:39 +0000 Original-Received: from localhost ([127.0.0.1]:53769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqS9a-0007zz-Ki for submit@debbugs.gnu.org; Tue, 17 Sep 2024 02:57:39 -0400 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:49307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqS9Y-0007zj-Tp for 73284@debbugs.gnu.org; Tue, 17 Sep 2024 02:57:37 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 06777C0002; Tue, 17 Sep 2024 06:56:54 +0000 (UTC) In-Reply-To: <86setzddrp.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 16 Sep 2024 14:44:10 +0300") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291925 Archived-At: >> The delete-pair command from lisp.el deletes a matched pair of >> delimiters. After using this command, I often want to operate on the >> region enclosed by the deleted delimiters. As far as I know, there's >> currently no quick way to access the end of that region. >> >> This patch introduces a custom option, delete-pair-push-mark. When >> enabled, it causes delete-pair to push a mark at the end of the >> enclosed region. >> >> This opens up various workflows. For instance, after deleting a pair, >> we can use C-x C-x to highlight the region and act on it further. > > Shouldn't this activate the region, instead of forcing users to do > that manually? Users that have transient-mark-mode enabled (which is > ON by default), will expect that, I think. Please don't activate the region since this command is not related to region selection. >> To err on the side of caution, I hid the new behavior behind a user >> option, disabled by default. I could just as well see it being turned >> on by default (or getting rid of the user option, making the new >> behavior "mandatory"), and am open to suggestions/feedback. > > I don't think doing this by default is a good idea. Such significant > changes in behavior are better off starting disabled. > > Let's see what others think about such optional behavior. I use delete-pair all the time, and sometimes indeed occurs the need to operate on the boundaries of the deleted delimiters afterwards. A workaround was to select the region before using delete-pair, and for example reindent it. But adding an easy way to do the same after using delete-pair by pushing the mark for 'C-x C-x' would be nice. This command doesn't use the region and I don't remember a need to use the mark immediately before or after executing this command, so it seems safe to push the mark without an option.