[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
doubt about mode hooks
From: |
Luca Ferrari |
Subject: |
doubt about mode hooks |
Date: |
Mon, 3 Jun 2013 16:51:51 +0200 |
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
- doubt about mode hooks,
Luca Ferrari <=