Emacs reselect region, as Vim shortcut 'gv' does

emacs

Solution

If Transient Mark mode is off, the region is always active. If it's on (which it sounds like is your situation), you can set `mark-even-if-inactive` to non-nil to allow region commands to work while the region isn't highlighted.

However, note you also can cycle back through previous mark positions using `C-u C-SPC` -- this will pop the mark ring. Once you're back to where you want to be, C-x C-x will rehighlight the region you want. (It may take a little bit of playing with this feature to get a feel for it, but it's why I can't switch away from Emacs now.)

Problem

In vim, visual block can be recall by 'gv' command so that multiple commands can be applied easily. (such as, comment out, then indent, then do_something_fun). In Emacs, how can this be achieved? [C-xC-x] only works when current cursor position stays where previous block ended. If previous block was changed, the closest is to go through 'point-to-register' and 'jump-to-register'. Just I am curious if there is an Emacs built-in command making this in one shot.

Original source