It’s time to revisit a subject I covered in 2014, using Emacs to open a Markdown file in Marked, an excellent Markdown previewer for OS X.1 I have used two different methods of opening files in Marked from Emacs, both of which have respective advantages.
The first is a function expressly for opening files in Marked. Add the following code to your emacs init file, and then press “Control-c m” to open the current file in Marked.
|
|
The second is a function for opening files in the default application for that type of file. This is part of Bozhidar Batsov’s Emacs Prelude starter kit, which I highly recommend. Again, add the following to your init file:
|
|
The second method is what I currently use. “Control-c o” opens the current file in the default application, which is set in the system. In order for it to work with Markdown files, you’ll need to make Marked the default application for Markdown files, which means that to open a file for editing from the Finder, you’ll need to right-click and select “Open With.” The advantage is that you can use the same command from Dired to open PDF’s in your preferred PDF reader, Word docs in Word, etc.
-
Its excellence lies partly in the fact that it’s not simply a previewer, it also does many other things, like word count, reading analyses, and link validation. ↩︎