1

有没有办法让一个词在文本模式下用不同的面孔呈现?

4

2 回答 2

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.
于 2009-11-05T19:32:11.547 回答
1

是的,

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

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

具体来说,您需要打开font-lock-mode,然后通过font-lock-add-keywords.

于 2009-11-05T19:23:58.583 回答