# HG changeset patch # User Oleksandr Gavenko # Date 1427889184 -10800 # Node ID ae5c2b9ab4bd64c30e0b67bc3f4de4e69ab4e85e # Parent 04e9ed4d22a1523225e49ab1077568bc930325a2 Avoid overriding text background - highlight only after line end. http://emacs.stackexchange.com/questions/10445/hl-line-mode-hide-background-how-to-avoid-this/ diff -r 04e9ed4d22a1 -r ae5c2b9ab4bd .emacs-my --- a/.emacs-my Tue Mar 31 14:35:29 2015 +0300 +++ b/.emacs-my Wed Apr 01 14:53:04 2015 +0300 @@ -760,10 +760,15 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (message "highlighting current line") +(defun my-hl-line-range-function () + (cons (line-end-position) (line-beginning-position 2))) +(setq hl-line-range-function #'my-hl-line-range-function) + (when window-system - (custom-set-faces '(hl-line ((t (:inherit highlight :background "light yellow"))))) - (global-hl-line-mode 1) - ) + (require 'hl-line) + (set-face-attribute 'hl-line nil :inherit nil :background "light yellow") + (setq global-hl-line-sticky-flag t) + (global-hl-line-mode 1)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (message "paren, braces")