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

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

Automagically disabling linum-mode for ERC buffers?


From: Henri Kemppainen
Subject: Automagically disabling linum-mode for ERC buffers?
Date: Wed, 3 Jun 2009 17:59:36 +0300
User-agent: Mutt/1.5.16 (2007-06-09)

Hello, ml.

I prefer to see line numbers for most of the time, so I have enabled
them using global-linum-mode.  However, I don't have much use for them
on IRC and would like to have them automatically disabled for all ERC
mode buffers.

To my surprise, adding (lambda () (linum-mode 0)) to erc-mode-hook
doesn't do the trick – the numbers will always appear when I start
typing into the buffer.  It looks as if disabling linum-mode leaves
a hook lurking around, but a quick peek at the code didn't support
this suspicion.  Any ideas?

For the time being, I work around the problem by adding
  (lambda (&rest IGNORE) (when linum-mode (linum-mode 0)))
to erc-insert-pre-hook.  This removes the linums when they're visible
and the server sends something to the channel.  Somewhat ugly, and
definitely annoying as I find it cleaner and more logical to set
things up in the modes' hooks.

I'm using Emacs 23.0.92.1 and the bundled versions of ERC & linum.

-- 
— DuClare





reply via email to

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