all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Trying to add a hook to show line numbers
@ 2007-04-18 13:35 jgombos
  2007-04-18 21:16 ` Sean Sieger
  0 siblings, 1 reply; 3+ messages in thread
From: jgombos @ 2007-04-18 13:35 UTC (permalink / raw)
  To: Help-gnu-emacs


I have successfully installed the linum.el library, and have the following
code in .emacs:

(require 'linum)

So in order to see line numbers, I interactively enter "M-x linum".  The
same command removes line numbers when applied again (it's a toggle).  I
want the default action to be to show line numbers.  I've tried this hook:

(setq ada-mode-hook
   'lambda () 'linum))

That was just a guess at how the hook should be composed.  It didn't work. 
I also tried:

(setq ada-mode-hook
   'lambda () linum))

..and..

(setq ada-mode-hook
   'lambda () (linum)))

..and..

(setq ada-mode-hook
   'linum))

There are never any errors, but the hooks simply do not trigger.
-- 
View this message in context: http://www.nabble.com/Trying-to-add-a-hook-to-show-line-numbers-tf3601014.html#a10058782
Sent from the Emacs - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Trying to add a hook to show line numbers
  2007-04-18 13:35 Trying to add a hook to show line numbers jgombos
@ 2007-04-18 21:16 ` Sean Sieger
  2007-04-19 13:26   ` jgombos
  0 siblings, 1 reply; 3+ messages in thread
From: Sean Sieger @ 2007-04-18 21:16 UTC (permalink / raw)
  To: help-gnu-emacs

jgombos <nabble.forum.jog@spamgourmet.com> writes:

   I have successfully installed the linum.el library, and have the following
   code in .emacs:

   (require 'linum)

   So in order to see line numbers, I interactively enter "M-x linum".  The
   same command removes line numbers when applied again (it's a toggle).  I
   want the default action to be to show line numbers.  I've tried this hook:

   (setq ada-mode-hook
      'lambda () 'linum))

   That was just a guess at how the hook should be composed.  It didn't work. 
   I also tried:

   (setq ada-mode-hook
      'lambda () linum))

   ..and..

   (setq ada-mode-hook
      'lambda () (linum)))

   ..and..

   (setq ada-mode-hook
      'linum))

   There are never any errors, but the hooks simply do not trigger.

Each of these has too many closing parentheses.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Trying to add a hook to show line numbers
  2007-04-18 21:16 ` Sean Sieger
@ 2007-04-19 13:26   ` jgombos
  0 siblings, 0 replies; 3+ messages in thread
From: jgombos @ 2007-04-19 13:26 UTC (permalink / raw)
  To: Help-gnu-emacs



Sean Sieger wrote:
> 
> Each of these has too many closing parentheses.
> 
Thanks for the catch, but I believe that may have just been a typo in my
post.  

Anyway, I just tried it again, and discovered that the hook works, and
probably worked before, but there's some kind of flaw that causes the line
numbers not to appear until I refresh the window.  So if I hit C-L, or move
the cursor, the line numbers appear.

BTW, I believe this is the correct command for me to have in the .emacs
file:

(add-hook 'ada-mode-hook 'linum)
-- 
View this message in context: http://www.nabble.com/Trying-to-add-a-hook-to-show-line-numbers-tf3601014.html#a10077830
Sent from the Emacs - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-04-19 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-18 13:35 Trying to add a hook to show line numbers jgombos
2007-04-18 21:16 ` Sean Sieger
2007-04-19 13:26   ` jgombos

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.