I highlight current line by evaluating:
(hl-line-mode)
It could also be set globally:
(global-hl-line-mode nil)
The problem is that this way line highlighting overrides highlight-phrase
. So my question is: "how to highlight both current line and a given phrase in this line?"
Both highlight-phrase
and hl-line
apply faces that have a background color set. hl-line
wins because it uses an overlay, and overlays always override text properties, which highlight-phrase
uses. I suggest that you work around this by customizing the hi-yellow
face to use a bright foreground color instead of a background color, or even a box.
So here's some, definetly not ideal, solution. Do:
M-x customize-face
emacs then asks you which one, and I did
hl-line
Then I turned off "inherit" flag (the last one), and turned on the "foreground" flag, - it was saying "black" - I made it red. After that You should save it all at the top of the page - either - for this seccion only, or for future sessions too.
That's it! This way current line text arrears of red font, while highlight-phrase
highlights the phrase with yellow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With