{"id":12220,"date":"2024-06-04T11:58:27","date_gmt":"2024-06-04T15:58:27","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=12220"},"modified":"2024-06-04T11:58:27","modified_gmt":"2024-06-04T15:58:27","slug":"tabs-or-spaces","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=12220","title":{"rendered":"TABs or Spaces"},"content":{"rendered":"<p>\nNo, I&rsquo;m not going to relitigate one of our favorite holy wars. Really, I don&rsquo;t care very much about the issue. Long ago, I arbitrarily settled on spaces but don&rsquo;t have strong feelings one way or the other and would change in an instant if there were a good reason.\n<\/p>\n<p>\nStill, lots of people <i>do<\/i> care and chansey97 over at the Emacs subreddit <a href=\"https:\/\/www.reddit.com\/r\/emacs\/comments\/1d3f5a7\/do_you_use_tab_or_space_for_indenting_emacs_lisp\/\">wants to know what people think<\/a>. The main way you express your preference in Emacs is with the <code>indent-tabs-mode<\/code> variable. If it&rsquo;s <code>t<\/code> TABs get used, otherwise only spaces are used. There are some finer adjustments possible but <code>indent-tabs-mode<\/code> is the important setting.\n<\/p>\n<p>\nTo my surprise, most of the respondents echoed my indifference. They basically said that they just want Emacs to do the right thing when they press the TAB key. That&rsquo;s actually pretty reasonable because the major modes <i>will<\/i> do the right thing\u2014or whatever you&rsquo;ve configured\u2014when you press TAB.\n<\/p>\n<p>\nHappily, your choice doesn&rsquo;t commit you to one or the other for <i>every<\/i> file. For example, I have an old file\u2014dating from my Vim days\u2014that has TAB delimited fields. At the top of that file I simply added\n<\/p>\n<div class=\"org-src-container\">\n<pre class=\"src src-elisp\"># -*- Mode: text<span style=\"color: #b22222;\">; <\/span><span style=\"color: #b22222;\">indent-tabs-mode: t -*-<\/span>\n<\/pre>\n<\/div>\n<p>\nand when I press TAB, an actual TAB character is inserted.\n<\/p>\n<p>\nI don&rsquo;t know what other editors do. I don&rsquo;t even remember how Vim handles the situation. It&rsquo;s enough to know that whatever your preference, Emacs has you covered.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>No, I&rsquo;m not going to relitigate one of our favorite holy wars. Really, I don&rsquo;t care very much about the issue. Long ago, I arbitrarily settled on spaces but don&rsquo;t have strong feelings one way or the other and would &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=12220\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18],"class_list":["post-12220","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\/12220","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=12220"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12220\/revisions"}],"predecessor-version":[{"id":12221,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12220\/revisions\/12221"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}