M-x all-things-emacs

Newbie Tip: transient-mark-mode

February 20th, 2007 by Ryan McGeary · 47 Comments

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.

transient-mark-mode

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.

Tags: newbie · quick · tips

47 responses so far ↓

  • 1 alephnull // Feb 20, 2007 at 7:49 am

    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.

  • 2 Yann Hodique // Feb 20, 2007 at 2:33 pm

    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

  • 3 Rob Christie // Feb 20, 2007 at 3:25 pm

    Also, if you happen to use pc-selection-mode it turns on transient-mark-mode automatically.

  • 4 Ryan McGeary // Feb 20, 2007 at 4:15 pm

    Yann is referring to Emacs 22, and C-SPC C-SPC is a good tip for those that don’t want to permanently enable transient-mark-mode.

  • 5 sean // Feb 25, 2007 at 5:43 am

    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.

  • 6 Jesper Juhl // Jan 10, 2010 at 10:19 pm

    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…

  • 7 retrot // Feb 18, 2010 at 12:33 pm

    Thank you jesper juhl!!!

  • 8 http://nikeause.exteen.com/20130709/goretex-protection-for-timberland-boots-canada // Jul 13, 2013 at 12:04 pm

    Newbie Tip: transient-mark-mode | M-x all-things-emacs

  • 9 Engagement rings // Jul 21, 2015 at 10:49 pm

    ... [Trackback]

    [...] Find More Informations here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 10 boxing trainer Seattle // Jul 22, 2015 at 12:55 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 11 amazin gas station video // Jul 24, 2015 at 9:15 am

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 12 amazin gas station video // Jul 24, 2015 at 10:30 am

    ... [Trackback]

    [...] Find More Informations here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 13 defense attorney // Jul 24, 2015 at 9:28 pm

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 14 special occasions limo service // Jul 25, 2015 at 1:51 pm

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 15 Locksmith Orangevale // Jul 26, 2015 at 6:32 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 16 locksmith Rancho Cordova ca // Jul 26, 2015 at 6:41 am

    ... [Trackback]

    [...] There you will find 92517 more Infos: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 17 where can you buy propecia // Jul 27, 2015 at 9:08 am

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 18 Marsna Design SEO // Jul 27, 2015 at 2:57 pm

    ... [Trackback]

    [...] Read More Infos here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 19 housekeepers // Jul 27, 2015 at 6:25 pm

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 20 online surf shop // Jul 28, 2015 at 8:08 am

    ... [Trackback]

    [...] There you will find 82752 more Infos: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 21 chiropractor Omaha, NE // Jul 31, 2015 at 6:22 pm

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 22 Prodaja staklene ambalaze // Aug 1, 2015 at 2:40 am

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 23 security companies // Aug 1, 2015 at 4:09 pm

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 24 septic tank replacement company // Aug 2, 2015 at 6:20 pm

    ... [Trackback]

    [...] Read More Infos here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 25 certifiedhandymen.net // Aug 2, 2015 at 7:29 pm

    ... [Trackback]

    [...] Find More Informations here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 26 tiptoproofers.net // Aug 2, 2015 at 11:34 pm

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 27 hop over to this website // Aug 2, 2015 at 11:35 pm

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 28 purchase cheap ventolin online // Aug 3, 2015 at 1:46 pm

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 29 http://www.tiptopelectric.org // Aug 4, 2015 at 2:22 am

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 30 tiptophvac.com // Aug 4, 2015 at 5:35 am

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 31 http://tiptopglassrepair.com // Aug 4, 2015 at 7:55 am

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 32 http://www.supremecontracting.net // Aug 4, 2015 at 4:44 pm

    ... [Trackback]

    [...] There you will find 59327 more Infos: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 33 flooringrestoration // Aug 5, 2015 at 7:01 am

    ... [Trackback]

    [...] Read More Infos here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 34 renewable energy solar panels // Aug 5, 2015 at 7:17 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 35 useful site // Aug 9, 2015 at 6:26 pm

    ... [Trackback]

    [...] There you will find 79390 more Infos: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 36 see here now // Aug 9, 2015 at 6:45 pm

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 37 Get More Information // Aug 10, 2015 at 10:10 pm

    ... [Trackback]

    [...] Find More Informations here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 38 find here // Aug 12, 2015 at 10:17 pm

    ... [Trackback]

    [...] Read More Infos here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 39 trending topics // Aug 13, 2015 at 12:24 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 40 where to buy backlinks // Aug 13, 2015 at 10:17 pm

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 41 www.chiefelectrical.net // Aug 13, 2015 at 11:44 pm

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 42 dental veneers // Aug 14, 2015 at 12:18 am

    ... [Trackback]

    [...] Read More Infos here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 43 majesticplumbers.com // Aug 14, 2015 at 4:17 am

    ... [Trackback]

    [...] There you will find 40847 more Infos: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 44 click for more info // Aug 14, 2015 at 4:40 am

    ... [Trackback]

    [...] There you will find 79792 more Infos: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 45 principalwindows.com // Aug 14, 2015 at 4:57 am

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 46 my site // Aug 14, 2015 at 4:59 am

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]

  • 47 http://www.rapidjunkremoval.net // Aug 14, 2015 at 9:56 am

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/02/20/newbie-tip-transient-mark-mode/ [...]