how to make emacs' zencoding-mode use single quote insted of double quote

亡梦爱人 提交于 2019-12-11 12:42:48

问题


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


回答1:


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:

(defun my-zencoding-hook ()
    (zencoding-mode))
(eval-after-load "zencoding-mode"
    '(defun zencoding-make-html-tag ()
       "Insert your modified version of zencoding-make-html-tag here"
       ...))

(add-hook 'sgml-mode-hook 'my-zencoding-hook)

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.



来源:https://stackoverflow.com/questions/8137540/how-to-make-emacs-zencoding-mode-use-single-quote-insted-of-double-quote

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!