unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* doubt about mode hooks
@ 2013-06-03 14:51 Luca Ferrari
  2013-06-03 15:21 ` Le Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Luca Ferrari @ 2013-06-03 14:51 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,
so far I've added mode hooks with something like the following:

(add-hook 'c-mode-hook (lambda()
                          (my-function-hook) )

but then I come across a snippet that does something different:

(setq my-personal-hook 'my-function-hook)
(add-hook c-mode-hook (lambda ()
          (run-hooks 'my-personal-hook) ) t )

so I was wondering what are the differences and which advantages
should I get using the second. I cannot see any particular advantage
from the manual, so I'm guessing the second effectively does not add
the hook itself, rather a function that runs the hook.
Any explaination?

Thanks,
Luca



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

end of thread, other threads:[~2013-06-03 20:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.929.1370271116.22516.help-gnu-emacs@gnu.org>
2013-06-03 20:14 ` doubt about mode hooks Emanuel Berg
2013-06-03 14:51 Luca Ferrari
2013-06-03 15:21 ` Le Wang

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).