Web模式不会在Aquamacs中自动启动 [英] web-mode won't start automatically in Aquamacs
问题描述
我似乎无法使配置正常工作,只有当我创建一个新的HTML时,它才能进入网络模式,而以其他任何方式进入默认的html模式.
I can't seem to get the configuration to work properly, only if I create a new HTML it goes into web-mode, any other way it goes into de default html-mode.
我正在使用Aquamacs 3.2 GNU Emacs 2.4.4.51.2
I'm using Aquamacs 3.2 GNU Emacs 2.4.4.51.2
尽管我在以前的版本中也遇到了同样的问题.
Though I have had this same problem with previous versions.
这是我的配置文件(Preferences.el):
Here's my config file (Preferences.el):
;; This is the Aquamacs Preferences file.
;; Add Emacs-Lisp code here that should be executed whenever
;; you start Aquamacs Emacs. If errors occur, Aquamacs will stop
;; evaluating this file and print errors in the *Messags* buffer.
;; Use this file in place of ~/.emacs (which is loaded as well.)
;; Melpa
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.[gj]sp\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
我知道这是在这里问到的:
I know this has been asked here:
Emacs(Aquamacs)网络模式不自动激活HTML文件
但是似乎没有一个具体的答案.
But there didn't seem to be a concrete answer.
有人可以指出我做错了什么吗?
Could anyone may point me to what I'm doing wrong?
推荐答案
尽管在邮件列表中使用了magic-mode-alist,但我还是收到了有效的答案:
I received a working answer at the mailing list, though it uses magic-mode-alist:
(setq magic-mode-alist '(("<!DOCTYPE html" . web-mode)))
这篇关于Web模式不会在Aquamacs中自动启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!