From: Luca Ferrari <fluca1978@infinito.it>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: doubt about mode hooks
Date: Mon, 3 Jun 2013 16:51:51 +0200 [thread overview]
Message-ID: <CAKoxK+425=_69guq-9nPbXuZ7a15LV38f57Xf6U=WBCkUKaznA@mail.gmail.com> (raw)
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
next reply other threads:[~2013-06-03 14:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-03 14:51 Luca Ferrari [this message]
2013-06-03 15:21 ` doubt about mode hooks Le Wang
[not found] <mailman.929.1370271116.22516.help-gnu-emacs@gnu.org>
2013-06-03 20:14 ` Emanuel Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAKoxK+425=_69guq-9nPbXuZ7a15LV38f57Xf6U=WBCkUKaznA@mail.gmail.com' \
--to=fluca1978@infinito.it \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).