GNU bug report logs -
#73284
[PATCH] Add option to push mark after delete-pair
Previous Next
Reported by: Paul Nelson <ultrono <at> gmail.com>
Date: Sun, 15 Sep 2024 20:59:02 UTC
Severity: normal
Tags: patch
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73284 in the body.
You can then email your comments to 73284 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73284
; Package
emacs
.
(Sun, 15 Sep 2024 20:59:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Paul Nelson <ultrono <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 15 Sep 2024 20:59:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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.
Alternatively, we can use C-M-k to delete the first sexp inside the
delimiters, then act on the remainder.
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.
Thanks, best,
Paul
[0001-Add-option-for-delete-pair-to-mark-end-of-region.patch (application/octet-stream, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73284
; Package
emacs
.
(Mon, 16 Sep 2024 11:45:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 73284 <at> debbugs.gnu.org (full text, mbox):
> From: Paul Nelson <ultrono <at> gmail.com>
> Date: Sun, 15 Sep 2024 22:58:09 +0200
>
> 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.
> 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.
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73284
; Package
emacs
.
(Mon, 16 Sep 2024 14:09:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 73284 <at> debbugs.gnu.org (full text, mbox):
Thank you for the feedback. I'll be happy to hear what others think.
> 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.
I've been using transient-mark-mode lately, and I actually prefer that
the proposed feature doesn't activate the region automatically, as I
don't always want to operate on the contents immediately.
But I understand your point about user expectations. We could
accommodate both preferences by expanding the option to accept the
values nil, 'push and 'activate.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73284
; Package
emacs
.
(Tue, 17 Sep 2024 06:58:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 73284 <at> debbugs.gnu.org (full text, mbox):
>> 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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73284
; Package
emacs
.
(Tue, 17 Sep 2024 09:22:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 73284 <at> debbugs.gnu.org (full text, mbox):
Hello,
The optional behaviour seems useful to me, and without activating the
mark, though I don't use delete-pair myself, so I'm kind of guessing.
(I have TMM turned on.)
--
Sean Whitton
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Sat, 21 Sep 2024 10:26:03 GMT)
Full text and
rfc822 format available.
Notification sent
to
Paul Nelson <ultrono <at> gmail.com>
:
bug acknowledged by developer.
(Sat, 21 Sep 2024 10:26:03 GMT)
Full text and
rfc822 format available.
Message #22 received at 73284-done <at> debbugs.gnu.org (full text, mbox):
> From: Paul Nelson <ultrono <at> gmail.com>
> Date: Sun, 15 Sep 2024 22:58:09 +0200
>
> 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.
> Alternatively, we can use C-M-k to delete the first sexp inside the
> delimiters, then act on the remainder.
>
> 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.
Thanks, installed on master, and closing the bug.
Please in the future make sure any new user options always have the
:version tag.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 19 Oct 2024 11:24:13 GMT)
Full text and
rfc822 format available.
This bug report was last modified 244 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.