在Emacs中,如何在css-mode中关闭缩写?

时间:2013-09-30 22:30:08

标签: css emacs

如何在css模式下关闭缩写模式?我在.emacs中有这个代码,但它不起作用。

(add-hook 'css-mode-hook (lambda () (abbrev-mode 0)))

1 个答案:

答案 0 :(得分:2)

来自手册:

 The mode command should accept one optional argument.  If called
 interactively with no prefix argument, it should toggle the mode
 (i.e., enable if it is disabled, and disable if it is enabled).  If
 called interactively with a prefix argument, it should enable the
 mode if the argument is positive and disable it otherwise.

所以:

(add-hook 'css-mode-hook (lambda () (abbrev-mode -1)))

同样引用 elisp info

 Disabling a minor mode in a mode hook is a little uglier:

      (add-hook 'text-mode-hook (lambda () (foo-mode -1)))

 However, this is not very commonly done.