5

A programming language that I use lets me format comments and docstrings using markdown, and then export my code and documentation to PDF.

When I edit the file, though, Emacs doesn't see comments as markdown; just as plain boring text.

I would like to access the full power of markdown-mode when I edit comments, without giving up the nice features of my programming languages' major mode outside of comments. How can I do this?

(A similar problem would include using a Javadoc specific mode map and syntax highlighting inside of Javadoc comments, for example)

1
  • I'm open to better tagging; mmm-mode doesn't seem to exist Commented Jun 22, 2015 at 17:54

1 Answer 1

5

You can use poporg for this. People mostly use it to edit comments in Org mode, but you can use whatever mode you want by setting poporg-edit-hook.

(remove-hook 'poporg-edit-hook 'org-mode) (add-hook 'poporg-edit-hook 'markdown-mode) 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.