snippets that defy orgmode tangling
Table of Contents
Literate Programing and snippets
The Problem: orgmode literate programing is incompatible with orgmode snippets
Submitted to the orgmode mailing list1 and to reddit2.
I have enjoyed using Orgmode for literate programming3 for years. I have a script that runs whenever there is a change to the file(s), retangling every tangle src block in the whole file. Just now I’ve finally acted to encode my snippets in my literate setup. For anyone unaware, snippets (I use yasnippet4) are shortcut keystrokes that transform into more elaborate text when used. The trouble is that orgmode interprets some text even when included in an SRC block, resulting in broken orghode structure or broken snippets. The problems arise in the org snippets (which I use heavily) and the LaTeX snippets, both of which org tries to interpret.
Although I’ve searched the variables and have found the tex:nil file option which allows me to handle the latex snippet, I still cannot find a way to include orgmode snippets without them being parsed and botching my orgmode file structure. Any suggestions would be welcame.
Footnotes
1 for more technical wizardry, the mailing list is at https://lists.gnu.org/archive/html/emacs-orgmode/.
2 Reddit in all its controversial glory has the post at https://www.reddit.com/r/emacs/comments/1ik0r6l/tangling_orgmode_snippets/
3 Literate programing for me is just meshing code and plain text, making for readability and a self-documenting organization. Wikipedia has full details at https://en.wikipedia.org/wiki/Literate_programming, an ancient eponymous website at http://www.literateprogramming.com/ exemplifies how long the term has been around, and the legendary Donald Knuth gave the idea wings with his book at https://cs.stanford.edu/~knuth/lp.html .
4 https://github.com/joaotavora/yasnippet is one of the oldest and most developed snippet systems in the community, still receiving daily requests and updates.