In emacs, after an operation such as comment-region
, the selected region is automatically deselected.
Is there any way of disabling this behaviour?
In emacs, after an operation such as comment-region
, the selected region is automatically deselected.
Is there any way of disabling this behaviour?
If the region is deselected, that sounds like you must be using transient-mark-mode
. In transient-mark-mode
, when you execute a command that operates on the region, the region is deselected (in particular, the mark remains, but it is inactive). You can reselect the region (reactivate the mark) using C-x C-x
(exchange-point-and-mark
).
If you want to disable the deselection entirely, you can turn off transient-mark-mode
. This means that you won't get any highlighting of the current region, though if you would like to set the mark and highlight the region, you can turn on transient mark mode briefly using C-<SPC> C-<SPC>
or C-u C-x C-x
.