{"id":9460,"date":"2021-02-03T16:02:58","date_gmt":"2021-02-03T21:02:58","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=9460"},"modified":"2021-02-03T16:02:58","modified_gmt":"2021-02-03T21:02:58","slug":"transient-mark-mode","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=9460","title":{"rendered":"Transient Mark Mode"},"content":{"rendered":"<p>If you\u2019ve been an Emacs user for a while, you probably know what transient mark mode is and you might even know that its use is\u2014or was\u2014controversial. It used to be disabled by default but in Emacs 23 the default was changed to enabled. I\u2019ve never understood the controversy. Why <i>wouldn\u2019t<\/i> you want the active region to be highlighted? I started with Emacs 21 and one of the first things I did was enable it. In fact, I just checked and it\u2019s still in my <code>init.el<\/code>. After almost a decade and a half of Emacs use, I still didn\u2019t understand the controversy. Until today.<\/p>\n<p><a href=\"https:\/\/twitter.com\/_wilfredh\/status\/1356873408416342016?s=20\">Wilfred Hughes<\/a> just tweeted a link to a post by Sean Whitton that <a href=\"https:\/\/spwhitton.name\/blog\/entry\/transient-mark-mode\/\">explains the transient mark mode controversy and gives some mitigations<\/a>. There are two problems with transient mark mode:<\/p>\n<ol class=\"org-ol\">\n<li>If you want to just set the mark (to jump back to it later, for example) you have to type <kbd>Ctrl<\/kbd>+<kbd>Space<\/kbd> <kbd>Ctrl<\/kbd>+<kbd>Space<\/kbd> instead of just <kbd>Ctrl<\/kbd>+<kbd>Space<\/kbd> to set the mark without activating it.<\/li>\n<li>When you use <kbd>Ctrl<\/kbd>+<kbd>x<\/kbd> <kbd>Ctrl<\/kbd>+<kbd>x<\/kbd> to switch the mark and point, it activates the region between them and you have to either precede the sequence with a <kbd>Ctrl<\/kbd>+<kbd>u<\/kbd> or follow it with a <kbd>Ctrl<\/kbd>+<kbd>g<\/kbd> to avoid the highlighting.<\/li>\n<\/ol>\n<p>The first isn\u2019t much of a problem. Especially for me since I don\u2019t set the mark manually very often. The second is a little more annoying but is hardly a deal breaker. In any event, Whitton gives a bit of Elisp to inactivate the mark after the switch so that the region doesn\u2019t get highlighted.<\/p>\n<p>There are some benefits to transient mark mode other than highlighting the region that you can read about in Whitton\u2019s post. He provides another bit of Elisp the provides those advantages without having to have transient mark mode enabled. He says that he has been running with the second\u2014but not the first\u2014fix enabled and transient mark mode disabled and found that he didn\u2019t mind not seeing the active region highlighted.<\/p>\n<p>That strikes me like living without air conditioning. Sure, you can do it but why? Whitton\u2019s post made me think that I made the right decision in enabling transient mark mode all those years ago but your mileage may vary. Read Whitton\u2019s post and make up your own mind. At least you\u2019ll know what the controversy is about.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve been an Emacs user for a while, you probably know what transient mark mode is and you might even know that its use is\u2014or was\u2014controversial. It used to be disabled by default but in Emacs 23 the default &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=9460\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18],"class_list":["post-9460","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9460"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9460\/revisions"}],"predecessor-version":[{"id":9461,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9460\/revisions\/9461"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}