Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have installed markdown-mode.el as described here. How do I get Emacs (specifically, Aquamacs) to load gfm-mode rather than markdown-mode for .markdown files? In case it's important, the relevant section(s) of my ~/.emacs currently look(s) like this:

(add-to-list 'load-path "~/.emacs.d/")

; Some irrelevant (I think) other stuff

(autoload 'markdown-mode "markdown-mode.el" "Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.mdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.mdt\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))

I'm extremely noobish with Emacs in general, so I'd appreciate step-by-step instructions.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Try replacing the lines you posted with these:

(add-to-list 'load-path "~/.emacs.d/")

;;; Markdown mode
(autoload 'gfm-mode "markdown-mode.el" "Major mode for editing Markdown files" t)
(setq auto-mode-alist (cons '("\\.text$" . gfm-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.md$" . gfm-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.mdown$" . gfm-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.mdt$" . gfm-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.markdown$" . gfm-mode) auto-mode-alist))

The important thing is to add 'gfm-mode before "markdown-mode.el" in the autoload command.

share|improve this answer
    
That just does the same thing as my current .emacs. I wanted it to load gfm-mode rather than markdown-mode. –  Ptharien's Flame Feb 17 '13 at 0:35
1  
@Ptharien'sFlame, sorry, I misunderstood your question. It should work now. –  terdon Feb 17 '13 at 22:47
    
That doesn't work at all, unless something else entirely is wrong: I get fill-mode when I shouldn't, and syntax highlighting in code fences is not active. –  Ptharien's Flame Feb 18 '13 at 0:46
1  
@Ptharien'sFlame, that I can't help you with. Perhaps the mode is not what you expect. Does emacs say it is in gfm-mode in the status bar? If yes, then the mode has been successfully loaded. –  terdon Feb 18 '13 at 1:03
    
It does say it's in gfm-mode, but it behaves like it's in standard markdown-mode. I guess you answered my question as stated. –  Ptharien's Flame Feb 18 '13 at 1:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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