I am using markdown mode with the modifications suggested in the excellent answer I received to a previous question. My aim is to have basic rendering capabilities within emacs itself so I can structure and format my text documents. I now would like to extend this so that:

  • _foo_ renders as foo;
  • *foo* renders as foo;
  • #Header renders as


  • `code` renders as code.

At the moment, my documents look like this:

emacs screenshot

I want it to look as it would if displayed on an SE page:


Normal text, bold text, italicized text, and code.

In other words, I would like to add italics, bold, headers and inline code and have them be visible in the emacs buffer I am editing, without needing to export the markdown document, and I would like formatting marks (such as #, _, * and backticks) to disappear once the format they define has been applied.

  • Org mode does something similar, depending on the variable org-hide-emphasis-markers. If you feel adventurous, you can look for uses of that variable in the org sources and see how they do it. Feb 8 '16 at 17:17
  • @HaraldHanche-Olsen well, the answer I got to my previous question also does something similar. Sadly, I know absolutely no lisp so my attempts to extend it to fit my needs here failed miserably. I doubt I'd fare any better with the org sources.
    – terdon
    Feb 8 '16 at 17:18
  • Okay, but then at least my comment may be useful to some other person who might want to help. (I don't have the time right now.) Feb 8 '16 at 17:20
  • @HaraldHanche-Olsen indeed it may. Sorry, I didn't mean to sound ungrateful, your comment was helpful. That I don't know lisp is nobody's problem but my own.
    – terdon
    Feb 8 '16 at 17:21
  • Hey, no problem. I have been on the 'net long enough to know how easy it is to misjudge people. So I always withhold judgement as long as possible, sometimes longer. 8-) Feb 8 '16 at 20:22

Markup hiding is now part of the current development version of Markdown mode. Markup for bold, italics, links, code, etc. can be hidden and toggled interactively using C-c C-x C-m (M-x markdown-toggle-markup-hiding). You can set the default value by customizing markdown-hide-markup. Additionally, this enables nice Unicode bullet characters for lists, with different bullets for different nested list levels. Horizontal rules and blockquotes will be styled nicely, too.

If you also want native syntax highlighting of code blocks (those for which the language name has been specified), you can toggle this with C-c C-x C-f (markdown-toggle-fontify-code-blocks-natively). You can set the default behavior by customizing markdown-fontify-code-blocks-natively.

Variable height heading faces have been around for a while now, too. Set markdown-header-scaling to t to enable that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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