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?
Thanks for your time.
br,
Chris
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/
☄
i also have tried to use (linum-mode 1) in certain mode like c,
without using the (global-linum-mode t), but i never see linum in c
files.
i think maybe there are some thing wrong in (global-linum-mode t),
because i firstly set it, and later in other mode, disable linum-mode
would be failed.
you are right.
i just tried open a new buffer type something to get some lines and
set it to c-mode and turn on linum-mode, and no line num shows.
However, using global-linum-mode shows the lin nums.
must be a bug. Reporting the bug would probably be helpful.
Xah