{"id":12579,"date":"2024-11-14T15:43:14","date_gmt":"2024-11-14T20:43:14","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=12579"},"modified":"2024-11-14T15:43:14","modified_gmt":"2024-11-14T20:43:14","slug":"m-x-occur","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=12579","title":{"rendered":"M-x Occur"},"content":{"rendered":"<p>\nKristoffer Balintona has a nice <a href=\"https:\/\/kristofferbalintona.me\/posts\/202411090000\/\">post<\/a> on Emacs occur. If you have moderate familiarity with Emacs, you have probably used occur on occasion. I use it all the time but still wasn&rsquo;t aware of everything it could do.\n<\/p>\n<p>\nHappily, Balintona is here to fill in the blanks. The information is all there in the documentation, of course, but it&rsquo;s easy to miss it when skimming through the doc looking for the information that you need.\n<\/p>\n<p>\nThe first significant thing is that you can restrict the action of Occur to a specific region of the target buffer. You probably won&rsquo;t want to do this very often but it&rsquo;s easy to see how it could be useful. The second significant thing is the number of lines of context.\n<\/p>\n<p>\nYou can specify how many lines of context before and after the matching regex to include but you can also specify a string in which case what is displayed acts as a replacement string. You certainly won&rsquo;t need that capability a lot but when you do, it&rsquo;s perfect.\n<\/p>\n<p>\nTake a look at Balintona&rsquo;s post or the <a href=\"https:\/\/www.gnu.org\/software\/emacs\/manual\/html_node\/emacs\/Other-Repeating-Search.html#index-occur\">documentation<\/a> for the details. This is another example of how learning Emacs is a lifelong endeavor. You learn bits and pieces of a certain functionality but later discover that it&rsquo;s much richer than you believed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kristoffer Balintona has a nice post on Emacs occur. If you have moderate familiarity with Emacs, you have probably used occur on occasion. I use it all the time but still wasn&rsquo;t aware of everything it could do. Happily, Balintona &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=12579\">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-12579","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\/12579","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=12579"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12579\/revisions"}],"predecessor-version":[{"id":12580,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12579\/revisions\/12580"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}