网络模式不会在 Aquamacs 中自动启动
web-mode won't start automatically in Aquamacs
我似乎无法让配置正常工作,只有当我创建一个新的 HTML 时它才会进入网络模式,任何其他方式它都会进入默认 html-模式。
我正在使用 Aquamacs 3.2 GNU Emacs 2.4.4.51.2
虽然我在以前的版本中遇到过同样的问题。
这是我的配置文件 (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))
我知道这里有人问过这个问题:
Emacs (Aquamacs) web-mode not automatically activating for HTML files
但似乎没有具体的答案。
谁能指出我做错了什么?
您是否尝试过将这些行放在 .emacs
的末尾?
我在邮件列表中收到了一个有效的答案,尽管它使用了 magic-mode-alist:
(setq magic-mode-alist '(("<!DOCTYPE html" . web-mode)))
我似乎无法让配置正常工作,只有当我创建一个新的 HTML 时它才会进入网络模式,任何其他方式它都会进入默认 html-模式。
我正在使用 Aquamacs 3.2 GNU Emacs 2.4.4.51.2
虽然我在以前的版本中遇到过同样的问题。
这是我的配置文件 (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))
我知道这里有人问过这个问题:
Emacs (Aquamacs) web-mode not automatically activating for HTML files
但似乎没有具体的答案。
谁能指出我做错了什么?
您是否尝试过将这些行放在 .emacs
的末尾?
我在邮件列表中收到了一个有效的答案,尽管它使用了 magic-mode-alist:
(setq magic-mode-alist '(("<!DOCTYPE html" . web-mode)))