I added the following to my .emacs
.
The hook is to convert tabs to spaces to avoid unpleasant
surprises with code blocks. For source to ska-untabify see the
EmacsWiki
(autoload 'markdown-mode "markdown-mode") (add-to-list 'auto-mode-alist '("\\.mdwn" . markdown-mode)) (add-hook 'markdown-mode-hook '(lambda () (make-local-hook 'write-contents-hooks) (add-hook 'write-contents-hooks 'ska-untabify nil t)));; [[DavidBremner]]