首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >web模式不会在Aquamacs中自动启动。

web模式不会在Aquamacs中自动启动。
EN

Stack Overflow用户
提问于 2015-03-04 18:08:52
回答 2查看 210关注 0票数 0

我似乎无法使配置正常工作,只有当我创建一个新的HTML它进入web模式,任何其他方式它进入默认的html-模式。

我正在使用Aquamacs3.2GNU Emacs 2.4.4.51.2

尽管我在以前的版本中遇到了同样的问题。

下面是我的配置文件(Preferences.el):

代码语言:javascript
复制
;; 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))

我知道这里有人问过:

Emacs (Aquamacs) web-mode not automatically activating for HTML files

但似乎没有一个具体的答案。

有人能告诉我我做错了什么吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-04-14 04:09:35

我在邮件列表上收到了一个有用的答复,尽管它使用的是魔术模式主义者:

代码语言:javascript
复制
(setq magic-mode-alist '(("<!DOCTYPE html" . web-mode)))
票数 0
EN

Stack Overflow用户

发布于 2015-03-04 22:46:05

你有没有试过把这些行放在你的.emacs的末尾?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28861738

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档