help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: disable linum-mode in other buffers, like eshell, compilation


From: Xah Lee
Subject: Re: disable linum-mode in other buffers, like eshell, compilation
Date: Wed, 08 Dec 2010 15:18:34 -0000
User-agent: G2/1.0

On Jul 13, 2:25 am, "z.cHris" <chrisdch...@gmail.com> wrote:
> Hi,
>
> I use linum-mode almost all the time, so i use (global-linum-mode t),
> but i don't want to use it in eshell mode, compilation mode, etc. in
> which the line number is useless.
>
> And also, when i use linum-mode in eshell or compilation mode, if a
> long line is printed, the cursor is paused in first lines, never
> scroll screen to the end of that line.
>
> I use
> (add-hook 'eshell-mode-hook
>  '(lambda () (linum-mode nil)))
>
> but can't work, is anyone know how to solve this problem?

if you want to turn it off, you should use 0, not nil. See:

• Emacs: How to Turn a Minor Mode on/off/toggle?
  http://xahlee.org/emacs/emacs-tip_mode_on_off_toggle.html

try that see if it address the problem. If that doesn't work, i
suspect it might be a bug, of the inter-relations of the global vs non-
global version...

instead of turning it off for particular modes, possibly more
practical is to turn it on for text related modes.

e.g.

(defun turn-spell-checking-on ()
  "Turn speck-mode or flyspell-mode on."
  (flyspell-mode 1)
  )

(add-hook 'text-mode-hook 'turn-spell-checking-on)

  Xah
∑ http://xahlee.org/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]