4

I like to use the markdown-mode for READMEs.

And I would like to use the markdown-mode as a minor-mode for comments in other major-modes like sh-mode. Is this possible somehow?

ceving
  • 1,308
  • 1
  • 14
  • 28
  • 1
    You seem to be confused about major and minor modes. markdown-mode is a major mode of which only one is active at a time. Minor modes serve a completely different purpose, enhancing a major mode in a possibly unrelated way. What you're looking for is a multi-mode combining major modes... – wasamasa Jul 06 '18 at 17:13
  • 3
    @wasamasa One could also interpret the question as: Is there a minor mode that **acts like** `markdown-mode` in comments (maybe restricted to buffers having major-modes derived from `prog-mode`). In that case I would say it is an interesting question. – Tobias Jul 07 '18 at 04:08
  • @Tobias That I am looking for. – ceving Jul 09 '18 at 08:12

1 Answers1

3

A markdown-minor-mode would be nice, yes. I currently have some ad-hoc code to highlight comments assuming markdown syntax for my typer-mode. It only supports a limited subset of markdown and only performs highlighting, but it shouldn't be difficult to extract it into its own markdown-minor-mode (probably easier than to try and adapt the code from markdown-mode major mode).

Stefan
  • 26,154
  • 3
  • 46
  • 84