this is a real problem i keep hitting
[ikiwiki] / doc / tips / Emacs_and_markdown.html
1 I added the following to my <code>.emacs</code>.
2
3 The hook is to convert tabs to spaces to avoid unpleasant 
4 surprises with code blocks. For source to ska-untabify see the
5 <a href="http://www.emacswiki.org/cgi-bin/wiki/UntabifyUponSave">EmacsWiki</a>
6 <pre>
7 (autoload 'markdown-mode "markdown-mode")
8 (add-to-list 'auto-mode-alist '("\\.mdwn" . markdown-mode))
9
10 (add-hook 'markdown-mode-hook  
11            '(lambda () 
12                (make-local-hook 'write-contents-hooks) 
13                 (add-hook 'write-contents-hooks 'ska-untabify nil t)))
14 </pre>
15
16 ;; [[DavidBremner]]