{"id":11829,"date":"2023-12-10T11:23:51","date_gmt":"2023-12-10T16:23:51","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=11829"},"modified":"2023-12-10T11:31:01","modified_gmt":"2023-12-10T16:31:01","slug":"marking-cut-regions","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=11829","title":{"rendered":"Marking Cut Regions"},"content":{"rendered":"<p>\nJust a quickie today. <a href=\"https:\/\/tech.toryanderson.com\">Tory Anderson<\/a> has an <a href=\"https:\/\/tech.toryanderson.com\/2023\/12\/07\/emacs-message-message-mark-inserted-region\/\">interesting post<\/a> illustrating something that I had no idea existed. You may\u2014especially if you&rsquo;re an old timer\u2014be familiar with &rsquo;&rsquo;cut marks&ldquo;. They&rsquo;re usually used to delimit code that an end user may want to cut out from longer text and use somewhere else. For example\n<\/p>\n<pre class=\"example\" id=\"orga0addf4\">\nHere is some introductory text that explains blah blah blah\n--8&lt;---------------cut here---------------start-------------&gt;8---\n(defun do-things ()\n  (do-something)\n  (do-something-else))\n--8&lt;---------------cut here---------------end---------------&gt;8---\nSome more blathering.  \n<\/pre>\n<p>\nAs Anderson says, they&rsquo;re not used as much as they were in the past but they can still be useful. Emacs, of course, has a way to insert them automatically. All you need do is mark the region you want to cut and call <code>message-mark-inserted-region<\/code> to insert the cut marks.\n<\/p>\n<p>\nHistorically, they were used in emails so Emacs has the keybinding <kbd>Ctrl<\/kbd>+<kbd>c<\/kbd> <kbd>Meta<\/kbd>+<kbd>m<\/kbd> in message mode to insert them but you can insert them anywhere by marking the region and calling <code>message-mark-inserted-region<\/code> directly. Note that <kbd>Ctrl<\/kbd>+<kbd>c<\/kbd> <kbd>Meta<\/kbd>+<kbd>m<\/kbd> works perfectly well in <code>mu4e<\/code> and probably all the other Emacs-based mail clients. If you find yourself using it more than once a month outside of email, you can bind your own key sequence to it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just a quickie today. Tory Anderson has an interesting post illustrating something that I had no idea existed. You may\u2014especially if you&rsquo;re an old timer\u2014be familiar with &rsquo;&rsquo;cut marks&ldquo;. They&rsquo;re usually used to delimit code that an end user may &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=11829\">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-11829","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\/11829","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=11829"}],"version-history":[{"count":2,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11829\/revisions"}],"predecessor-version":[{"id":11831,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11829\/revisions\/11831"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11829"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11829"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}