在emacs中,如何仅突出显示当前帧中的当前行?

时间:2021-04-28 07:29:16

In Emacs (23 on Mac Leopard), I've discovered how to highlight the current line with hl-line-mode, but when using it globally in all buffers, it highlights the current line in all buffers in all frames.

在Emacs(Mac Leopard上的23个)中,我发现了如何使用hl-line-mode突出显示当前行,但是当在所有缓冲区中全局使用它时,它会突出显示所有帧中所有缓冲区中的当前行。

I'd like to be able to highlight the current line (or at least have a different face for it) in only the currently active buffer. I'm sure this must be possible to some degree as the cursor changes dependent on whether the buffer is the current one or not.

我希望能够仅在当前活动的缓冲区中突出显示当前行(或者至少有一个不同的面)。我确信这在某种程度上是可能的,因为光标的变化取决于缓冲区是否是当前缓冲区。

Thanks

Singletoned

1 个解决方案

#1


Looking at the documentation for hl-line-mode, it appears that you might have the variable hl-line-sticky-flag turned on. Try

查看hl-line-mode的文档,看起来您可能已打开变量hl-line-sticky-flag。尝试

C-h v hl-line-sticky-flag

to see if it's non-nil, and if so, then add

看看它是否为非零,如果是,则添加

(setq hl-line-sticky-flag nil)

to your .emacs.

到你的.emacs。

#1


Looking at the documentation for hl-line-mode, it appears that you might have the variable hl-line-sticky-flag turned on. Try

查看hl-line-mode的文档,看起来您可能已打开变量hl-line-sticky-flag。尝试

C-h v hl-line-sticky-flag

to see if it's non-nil, and if so, then add

看看它是否为非零,如果是,则添加

(setq hl-line-sticky-flag nil)

to your .emacs.

到你的.emacs。