[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#73284: [PATCH] Add option to push mark after delete-pair
From: |
Juri Linkov |
Subject: |
bug#73284: [PATCH] Add option to push mark after delete-pair |
Date: |
Tue, 17 Sep 2024 09:56:00 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) |
>> 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.