Aquamacs 有一个默认的 html-helper-mode
来编辑具有奇怪行为的 .html
文件。我想默认切换回常规 html-mode
。
我读到我需要更改 magic-mode-alist
才能这样做。
据我了解 documentation , 将其添加到我的 .emacs
应该可以解决问题:
(setq magic-mode-alist '(("\\.html" . html-mode)))
不幸的是,它并没有改变任何东西。
我读了elsewhere将其设置为 nil
应该可以,但也没有。
知道我错过了什么吗?
提前致谢。
最佳答案
根据the page I linked ,第一个要修改的变量是 magic-mode-alist
,它优先于 auto-mode-alist
。
我只是在匹配列表的开头添加了一个值,使用与 magic-mode-alist
中完全相同的正则表达式指向 html-helper-mode
:
(add-to-list 'magic-mode-alist
'("\\(?:<\\?xml\\s +[^>]*>\\)?\\s *<\\(?:!--\\(?:[^-]\\|-[^-]\\)*-->\\s *<\\)*\\(?:!DOCTYPE\\s +[^>]*>\\s *<\\s *\\(?:!--\\(?:[^-]\\|-[^-]\\)*-->\\s *\<\\)*\\)?[Hh][Tt][Mm][Ll]"
. html-mode))
像魅力一样工作。享受 Aquamacs 而不用担心 html-helper-mode
。
关于html - 在 Aquamacs 中默认禁用 html-helper-mode 以编辑 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14032801/