{"id":7912,"date":"2015-11-09T01:19:31","date_gmt":"2015-11-09T01:19:31","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/11\/09\/how-to-display-indentation-guides-in-emacs-open-source-projects-thoughtbot-guides\/"},"modified":"2015-11-09T01:19:31","modified_gmt":"2015-11-09T01:19:31","slug":"how-to-display-indentation-guides-in-emacs-open-source-projects-thoughtbot-guides","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/11\/09\/how-to-display-indentation-guides-in-emacs-open-source-projects-thoughtbot-guides\/","title":{"rendered":"How to display indentation guides in Emacs?-open source projects thoughtbot\/guides"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a8995338f6de0fdfd5a0b8da5403590c?s=128&amp;d=identicon&amp;r=PG\" \/> <strong>antonj<\/strong><\/p>\n<p>I&#8217;ve made a function <code>highlight-indentation<\/code> for this purpose, code is on github.<\/p>\n<p>When invoking <code>highlight-indentation<\/code> without a prefix argument the current indentation level is naively guessed from major mode (python, ruby and languages based on cc-mode). Only works for space indentations. Customize <code>highlight-indent-face<\/code> to change appearance of indentation lines.<\/p>\n<p>Examples (ruby, python): <img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/F509p.png\" \/><\/p>\n<p>I also frequently use this snippet that folds all code on an indentation level greater than the current line. It&#8217;s a great way of getting a quick overview of the outline.<\/p>\n<pre><code>(defun aj-toggle-fold ()\n  \"Toggle fold all lines larger than indentation on current line\"\n  (interactive)\n  (let ((col 1))\n    (save-excursion\n      (back-to-indentation)\n      (setq col (+ 1 (current-column)))\n      (set-selective-display\n       (if selective-display nil (or col 1))))))\n(global-set-key [(M C i)] 'aj-toggle-fold)\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>antonj I&#8217;ve made a function highlight-indentation for this purpose, code is on github. When invoking highlight-indentation without a prefix argument the current indentation level is naively guessed from major mode (python, ruby and languages based on cc-mode). Only works for space indentations. Customize highlight-indent-face to change appearance of indentation lines. Examples (ruby, python): I also [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7912","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7912","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7912"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7912\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}