[OS X Emacs] I can't get Aquamacs to start by default with a mode

Marc Shapiro -- at work marc.shapiro at acm.org
Wed Apr 8 16:08:19 EDT 2015


> Date: Tue, 7 Apr 2015 14:03:46 -0600
> From: Eduardo San Miguel <abx88as at gmail.com>
> Subject: Re: [OS X Emacs] Delayed Mail (still being retried)
> 
> I can't get Aquamacs to start by default with a mode I installed (web-mode
> to be precise). I have asked in stackoverflow and was recommended to post
> to this mailing list:
> 
> [...]
> (add-to-list 'auto-mode-alist '("\\.html$" . web-mode))

This is not sufficient.  Some files types are recognised by their extension, in auto-mode-alist as you tried, but others are recognized by content, in magic-mode-alist.

Here is what works for me, in my .emacs [you will need to replace html-helper-mode by web-mode]:

(setq magic-mode-alist
      '(("\`<!DOCTYPE HTML" . html-helper-mode)
("\\(?:<\\?xml\\s +[^>]*>\\)?\\s *<\\(?:!--\\(?:[^-]\\|-[^-]\\)*-->\\s *<\\)*\\(?:!DOCTYPE\\s +[^>]*>\\s *<\\s *\\(?:!--\\(?:[^-]\\|-[^-]\\)*-->\\s *<\\)*\\)?[Hh][Tt][Mm][Ll]" . html-helper-mode)
	("<\\?xml " . xml-mode)
	("%![^V]" . ps-mode)
	("# xmcd " . conf-unix-mode)))

								Marc



More information about the MacOSX-Emacs mailing list