Avoid overriding text background - highlight only after line end.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 01 Apr 2015 14:53:04 +0300
changeset 1277 ae5c2b9ab4bd
parent 1276 04e9ed4d22a1
child 1278 8e47e801be9d
Avoid overriding text background - highlight only after line end. http://emacs.stackexchange.com/questions/10445/hl-line-mode-hide-background-how-to-avoid-this/
.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")