mmm-mode
mmm-mode copied to clipboard
Possible to add classes within an emacs mode?
In mmm-mode, can one define new classes within the emacs lisp file that defines a new custom mode rather than in the initializion file? That way, would I have to use the mmm-add-mode-ext-class function, or would I use other mmm-add functions?
Yes, this is possible. But mmm-mode settings do not generally belong with the definition of a major mode, because mmm-mode's purpose is exactly to tie multiple major modes together. Do you have a concrete example to ask about?
Yes, in my case I would like to (at a high level) include major modes in simple code blocks with the beginning and ending syntax (like c_code...end_c_code) in my custom emacs mode. I spoke with Jason Blevins and he mentioned copying from org-mode (at a relatively low level) to define code blocks in markdown documents. However, I am not an emacs guru, so I cannot extract the bits of his code that can do this bit of functionality.
For reference, this is his blog article about using mmm-mode to initially define code blocks within markdown documents.