Every time I open a new file in emacs, hl-line-mode is enabled. I have put

(global-hl-line-mode -1)
(hl-line-mode -1)

in my init.el, but to no avail. What am I doing wrong???

  • 4
    Find out what is turning the mode on. If you don't see the same behavior when starting Emacs without an init file (emacs -Q) then recursively bisect your init file to find out where you are turning it on. Look after you turn it off in your init file.
    – Drew
    Commented Feb 16, 2017 at 4:02
  • The commands given above are the last two in my init.el file.
    – MathManM
    Commented Feb 16, 2017 at 4:34
  • I have also verified that this file is being used by emacs.
    – MathManM
    Commented Feb 16, 2017 at 4:41
  • 4
    Can you turn it of after your emacs is loaded? Aka eval M-: (global-hl-line-mode -1) and does this turn the hightlight off? I gues some mode has this set as a hook when it is being loaded. So the question is which packages do you have installed, and checking which ones might do it. Commented Feb 16, 2017 at 10:08
  • 1
    If those are the last two lines in your init, then something earlier in the file is causing the problem. You really do need to follow @Drew s advice to find out what the source is. more details on troubleshooting
    – Tyler
    Commented Feb 16, 2017 at 16:28


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.