tags:

views:

145

answers:

3

Hi -

I use Cocoa Emacs 23.1.91 and I want to always have hl-line-mode turned off as I don't like using it. I can turn it off per buffer via M-x hl-line-mode, but that is tedious. Any help is appreciated!

Thanks

+4  A: 

M-x global-hl-line-mode


doc:

global-hl-line-mode is an interactive compiled Lisp function in `hl-line.el'. (global-hl-line-mode &optional ARG)

Global minor mode to highlight the line about point in the current window. With ARG, turn Global-Hl-Line mode on if ARG is positive, off otherwise.

Global-Hl-Line mode uses the functions global-hl-line-unhighlight' and global-hl-line-highlight' on pre-command-hook' andpost-command-hook'.

Tuomas Pelkonen
Thanks for responding. I could see from the minibuffer message that this function did execute, however, I still have the hl-line. Perhaps it is a feature of the Ruby mode I am using as part of the Emacs Starter Kit set of initializations. I will investigate there about overriding that feature in Ruby mode.
m7d
If invoking it interactively, with M-x, you need to prefix it with `universal-argument`. I have this bound to C-u . If putting it in your .emacs, then use `(global-hl-line-mode 0)`. I updated the answer with the documentation for the fn.
Cheeso
+3  A: 

If you want to have it always disabled it's probably best to add this line to your .emacs:

(global-hl-line-mode -1)
Bozhidar Batsov
Thanks for responding. As per above, I will check out if I can override this in Ruby mode, as it seems to be possibly coming from there (since I don't have it everywhere). I did add that to my .emacs file though to catch it elsewhere and it seemed to work.
m7d
+2  A: 

if you are having this enabled by the mode (I'm pretty sure you would have to request it explicitly) you can always add this to your .emacs

(add-hook 'ruby-mode-hook
  (lambda()
    (hl-line-mode -1)
    (global-hl-line-mode -1))
  't
)

as the last line of config. 't is important as it will tell emacs to append this hook at the end of all hooks for the mode

radekg
You solved it, thanks!!!! If I had the reputation I would give you heaps of points, but the system won't allow me to yet.
m7d
I want to also turn off auto-fill-mode in ruby-mode so I tried:(add-hook 'ruby-mode-hook (lambda() (auto-fill-mode -1) (hl-line-mode -1) (global-hl-line-mode -1)) 't)but no dice. The hl-line-mode stuff works as expected, which is great, but I haven't found how to turn off auto fill in ruby-mode. Any ideas?
m7d