Making a region-indent-function keep the region marked

馋奶兔 提交于 2019-12-05 13:22:48

The region is reset after the command completes, so calling activate-mark does not have any effect. Throwing an error (a non-local exit) apparently prevents this step, but that might be a bug.

The trick is: deactivate-mark

If an editing command sets this to t, deactivate the mark afterward. The command loop sets this to nil before each command, and tests the value when the command returns. Buffer modification stores t in this variable.

So just do this at the end of your command:

  (setq deactivate-mark nil)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!