Setting a mark (C-SPC) is probably the most frequent command I use besides basic navigation. The mark not only acts as a saved jump-to point, but it also sets the region. A region is what other editors might call a selection. By default, emacs does not highlight the active region, so it requires a bit of imagination to visualize it. To change that behavior, add this to your .emacs.
(setq transient-mark-mode t)
This turns the Transient Mark minor mode on. In Transient Mark mode, when the mark is active, the region is highlighted.

Note: Some commands change their behavior when transient mark mode is on and the mark is active. Personally, I like the changed behavior, but invoke C-h d transient for more information.
7 responses so far ↓
I used to track multi-tty and I found that tmm breaks the menubar sometimes. I have not encountered this problem ever since I started using unicode-2 with the GTK UI.
It is worth noting that in the next major version of GNU Emacs, pressing C-SPC two times in a row enables transient-mark-mode temporarily.
This way, one is able to take advantage of the modified behavior of some commands (comment-dwim for example) without enabling the “region selection” globally.
Personally I like to use the mark not only for defining a region, but also simply for marking a place I’ll come back later to, with C-u C-SPC
Also, if you happen to use
pc-selection-modeit turns ontransient-mark-modeautomatically.Yann is referring to Emacs 22, and
C-SPC C-SPCis a good tip for those that don’t want to permanently enabletransient-mark-mode.Yann — C-u C-spc has to be one of the most underrated Emacs commands. I happen to find that TMM + C-spc + C-g to cancel region highlighting is more efficient for me, but it’s a matter of taste.
Just wanted to say, that if you are like me and find transient-mark-mode annoying and your distribution has made emacs enable it by default (as mine does), then it’s easy to disable by just setting
(setq transient-mark-mode nil)
in your ~/.emacs file…
Thank you jesper juhl!!!
Leave a Comment