Marking Cut Regions

Just a quickie today. Tory Anderson has an interesting post illustrating something that I had no idea existed. You may—especially if you’re an old timer—be familiar with ’’cut marks“. They’re usually used to delimit code that an end user may want to cut out from longer text and use somewhere else. For example

Here is some introductory text that explains blah blah blah
--8<---------------cut here---------------start------------->8---
(defun do-things ()
  (do-something)
  (do-something-else))
--8<---------------cut here---------------end--------------->8---
Some more blathering.  

As Anderson says, they’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 message-mark-inserted-region to insert the cut marks.

Historically, they were used in emails so Emacs has the keybinding Ctrl+c Meta+m in message mode to insert them but you can insert them anywhere by marking the region and calling message-mark-inserted-region directly. Note that Ctrl+c Meta+m works perfectly well in mu4e 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.

This entry was posted in General and tagged . Bookmark the permalink.