3

I'm having an issue similar to the one described here:

Disable hl-line in Emacs when using Emacs Starter Kit?

I am using Emacs 24 for OS X ( http://emacsformacosx.com/ ), invoked with the -nw flag to run it in the terminal (so I can have true fullscreen). I started my customizations with the Emacs Starter Kit ( https://github.com/technomancy/emacs-starter-kit ). Most of the things I've added are working well.

但是,我已经注意到我的语法突出显示在突出显示所选行时不显示(所有文本是相同的颜色)。我喜欢这种line-highlight效果,但不想放弃语法高亮。有没有办法做到这一点(特别是在终端)?

我的语法/背景着色是使用custom-theme.

谢谢你的帮助。

编辑:我正在使用狮子。

4

2 回答 2

5

嗯,我认为您必须hl-line使用M-x customize-face RET hl-line. 然后确保它没有其他属性(甚至没有inherit属性)并且它定义的只是背景颜色。突出显示的行应该用该背景颜色突出显示,但让现有的语法突出显示。

另一种方法是使用https://github.com/sellout/emacs-color-theme-solarized/上的“solarized”主题。这些已经解决了这个问题。

编辑:实际上您可以保留该inherit属性,只需确保该 face 不会覆盖您想要作为语法突出显示的属性。

于 2012-08-21T00:46:28.700 回答
2

因为我们不知道您使用的是什么版本的 OS X,所以这是在黑暗中刺探。在 Lion 之前,Terminal.app 不支持 256 色,所以:

  1. 它在 Emacs.app 中运行良好吗?
  2. 如果是这样,您运行的是 Lion 之前的 OS X 版本吗?
    • 如果是,并且您不想(或不能)升级您的操作系统:尝试使用iTerm 2作为您的终端,然后看看 emacs 是如何工作的。
    • 如果不是:也许其他人可以提供帮助。
于 2012-08-20T19:29:29.537 回答