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

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

Re: enabling setnu-mode on startup


From: Kevin Rodgers
Subject: Re: enabling setnu-mode on startup
Date: Tue, 29 Aug 2006 13:25:06 -0600
User-agent: Thunderbird 1.5.0.5 (Windows/20060719)

Tejas Kokje wrote:
Hello,

I am using setnu.el script from
http://www.wonderworks.com/download/setnu.el.

I have edited my .emacs file and I am able to get line numbers on my
current buffer with  'M-x setnu-mode' . However, if I open a new
buffer, those line numbers don't show up there and I have to redo 'M-x
setnu-mode'.

That's the way almost all minor modes work: they are buffer local.

What should I put in my .emacs file so that I have to do 'M-x
setnu-mode' only once for all buffers ? Also is there a way I can
enable setnu-mode on emacs startup so that I don't have to type in
every time I fire up emacs ?

This will take care of all buffers that are visiting files (vs.
*scratch*, *Messages*, *info*, *shell*, etc.):

(add-hook 'find-file-hook 'turn-on-setnu-mode)
(add-hook 'find-file-not-found-hooks 'turn-on-setnu-mode)

--
Kevin





reply via email to

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