This question already has an answer here:

org-babel allows editing source code of arbitrary modes inside an .org file.

I'd like to do this (with different syntactic markers) inside my major mode, but org-babel is very specific to org.

Is there a library that allows one to embed major modes (at least the font-locks) inside a code block in another major mode? Otherwise I guess I need to copy/pasta the relevant parts of org-babel.

marked as duplicate by Tyler, Community Oct 26 '18 at 13:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Please add some more info - in which way it should behave different from org-babel? What to keep? – Andreas Röhler Oct 26 '18 at 6:15
  • I don't know what to add. I basically want org-babel inside my major mode. e.g. say I have a SQL string embedded in my source code (with some special markers, say $$$, not BEGIN_SRC), I want to be able to use sql-mode font-locks in there. – fommil Oct 26 '18 at 8:34

Maybe try the following packages:





WRT to literate programming this seems worth to look at too:


Not the answer you're looking for? Browse other questions tagged or ask your own question.