Emacs地区亮点 [英] Emacs region highlighting

查看:91
本文介绍了Emacs地区亮点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法突出显示字体锁定模式的缓冲区中的文本(但不是全部这样的字符串)中的字符串。

Is there a way to highlight a string in a text (but not ALL such strings) in a buffer where font-lock-mode is on.

让我们假设我有一个SQL模式的缓冲区,我想突出显示一个字符串。
以下代码不起作用

Let's imagine I have a buffer with SQL mode and I want to highlight a string in it. The following code does not work

(set-text-properties 10 20 '(face hi-yellow))

当我打电话

(font-lock-mode -1)

它的工作,但所有的sql突出显示消失。

it works, but all sql highlighting disappears.

必须有一个解决方案,因为可以选择一个区域,它将被突出显示,但我无法弄清楚如何以编程方式执行

There must be a solution because it's possible to select a region and it will be highlighted but I can't figure out how to do it programmatically

推荐答案

看看 http://www.emacswiki.org/emacs/HighlightTemporarily

MarkerPens和Highlight都提供突出显示某个区域的功能。

Both MarkerPens and Highlight provide functions to highlight a region.

这篇关于Emacs地区亮点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆