mmm-mode icon indicating copy to clipboard operation
mmm-mode copied to clipboard

Possible to add classes within an emacs mode?

Open tanimislam opened this issue 8 years ago • 3 comments

tanimislam avatar Jun 04 '17 06:06 tanimislam

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?

tanimislam avatar Jun 04 '17 06:06 tanimislam

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?

purcell avatar Jun 04 '17 07:06 purcell

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.

tanimislam avatar Jun 12 '17 22:06 tanimislam