Emacs:操作后保持选中区域 [英] Emacs: keep region selected after operation
问题描述
在emacs中,经过comment-region
等操作后,选中的区域会自动取消选中.
In emacs, after an operation such as comment-region
, the selected region is automatically deselected.
有什么办法可以禁用这种行为吗?
Is there any way of disabling this behaviour?
推荐答案
如果取消选择区域,那听起来您必须使用 transient-mark-mode
.在transient-mark-mode
中,当你执行一个对区域进行操作的命令时,该区域会被取消选择(特别是,标记仍然存在,但它处于非活动状态).您可以使用 C-x C-x
(exchange-point-and-mark
) 重新选择区域(重新激活标记).
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
).
如果您想完全禁用取消选择,您可以关闭transient-mark-mode
.这意味着您不会得到当前区域的任何突出显示,但如果您想设置标记并突出显示该区域,您可以 使用 C-
C-C-u C-x C-x
.
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
.
这篇关于Emacs:操作后保持选中区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!