让 emacs 始终关闭 html 标签
如何让 emacs 始终关闭 sgml 标签 (CcCt)?
例如 div
、h2
标签可以正常工作,但 p
或 li
则不行。 基本上,我正在寻找一种指定在插入标签时始终使用 xhtml 的方法。
How can I make emacs always close a sgml-tag (C-c-C-t)?
For example div
, h2
tags work fine but p
or li
do not.
Basically I'm looking for a way of specifing that I'm always using xhtml when I insert a tag.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要打开
sgml-xml-mode
:sgml-mode
尝试通过查看文档类型来猜测您的缓冲区是否采用 XHTML(因此自动打开sgml-xml-mode
)。请参阅函数sgml-xml-guess
。它期望在 DTD 名称中的某处找到字符串"XHTML"
。如果您无法使
sgml-xml-guess
工作,那么您可以显式打开sgml-xml-mode
。也许像这样:You need to turn on
sgml-xml-mode
:sgml-mode
attempts to guess whether your buffer is in XHTML (and so turn onsgml-xml-mode
automatically) by looking at the doctype. See the functionsgml-xml-guess
. It's expecting to find the string"XHTML"
somewhere in the DTD name.If you can't get
sgml-xml-guess
to work, then you could turn onsgml-xml-mode
explicitly. Perhaps like this: