unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Automagically disabling linum-mode for ERC buffers?
@ 2009-06-03 14:59 Henri Kemppainen
  0 siblings, 0 replies; only message in thread
From: Henri Kemppainen @ 2009-06-03 14:59 UTC (permalink / raw)
  To: help-gnu-emacs

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





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-03 14:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-03 14:59 Automagically disabling linum-mode for ERC buffers? Henri Kemppainen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).