2009-11-05 170 views

回答

5

查看`highlight-regexp'。只需输入你想改变面部的单词(虽然它可以是任何正则表达式)。

M-X亮点,正则表达式

highlight-regexp is an alias for `hi-lock-face-buffer' in 
`hi-lock.el'. 

It is bound to M-s h r. 

(highlight-regexp regexp &optional face) 

Set face of each match of regexp to face. 

Interactively, prompt for regexp then face. Buffer-local history 
list maintained for regexps, global history maintained for faces. 
Use M-p to retrieve previous history items, 
and M-n to retrieve default values. 
1

是,

你想要的是字体锁定模式。

在这里看到:http://www.gnu.org/software/emacs/manual/html_node/emacs/Font-Lock.html

具体你要打开font-lock-mode,然后通过font-lock-add-keywords指定关键字的列表。

+0

吧?在文本模式? – Bahbar 2009-11-05 21:25:55

+0

当然,为什么不呢,你只需要为文本模式添加一个钩子。我刚刚在我的本地机器上完成了它。你认为什么不可能? – chollida 2009-11-05 21:32:21