如何制作 emacs' zencoding-mode 使用单引号代替双引号
我在编写html时使用单引号,但是zencoding-mode的扩展代码使用双引号。
我找不到关于此的自定义选项,我的 zencoding-mode 来自 https://github.com/rooney/禅编码
I use single quote when writing html, but zencoding-mode's expanding code use double quote.
I can't find a customize option about this, my zencoding-mode comes from https://github.com/rooney/zencoding
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来
"
被硬编码到源代码中,因此没有直接的方法来自定义它。这很容易做到,所以也许您可以向维护者提交功能请求。在同时,看起来您需要的是
zencoding-make-html-tag
的修改版本,将"\""
的所有实例替换为"'"
。您可以将函数的自定义版本添加到 .emacs 中,并使用挂钩在 zencoding 后加载它。像下面这样的事情可能会做到这一点:更简单但更容易出现意外的是在 zencoding-mode.el 本身的源代码中进行搜索和替换,因为它从您下载到的任何地方运行。每当您更新版本时,这都会中断,并且可能会中断其他标记语言的行为,但它既快速又简单。
It looks like the
"
is hard-coded into the source, so there's not direct way to customize it. It would be easy to do, so perhaps you could submit a feature request to the maintainer.In the meantime, it looks like what you need is a modified version of
zencoding-make-html-tag
, replacing all instances of"\""
with"'"
. You could add a custom version of the function to your .emacs, with a hook to load it after zencoding. Something like the following might do it:Easier but more prone to surprises would be to do a search-and-replace in the source of zencoding-mode.el itself, since it runs from wherever you downloaded it to. This will break whenever you update your version, and might break behaviour for other markup languages, but it's quick and easy.