2009-11-05 106 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