From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: run-hooks vs. run-mode-hooks.
Date: Fri, 27 May 2005 12:07:32 -0400 [thread overview]
Message-ID: <jwvvf548xjs.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <f7ccd24b050527010157b9bea3@mail.gmail.com> (Juanma Barranquero's message of "Fri, 27 May 2005 10:01:30 +0200")
> (if (fboundp 'function-in-doubt)
> (defalias 'mymodule-function-in-doubt 'function-in-doubt)
> (defun mymodule-function-in-doubt ...))
Actually this form has the disadvantage that the byte-compiler would have to
check which functions are defnied in every branch. And snice it doesn't do
that as of now, the byte-compiler won't noticve that this form does define
`mymodule-function-in-doubt' and will hencforth issue warnings when you call
that function.
Better use:
(defalias 'mymodule-function-in-doubt
(if (fboundp 'function-in-doubt)
'function-in-doubt
(lambda (..) ...)))
which makes it trivially obvious that `mymodule-function-in-doubt' will
indeed always be defined.
Stefan
next prev parent reply other threads:[~2005-05-27 16:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-25 12:28 run-hooks vs. run-mode-hooks Lute Kamstra
2005-05-26 5:59 ` Richard Stallman
2005-05-27 0:58 ` Katsumi Yamaoka
2005-05-27 1:40 ` Lute Kamstra
2005-05-27 3:32 ` Katsumi Yamaoka
2005-05-27 8:01 ` Juanma Barranquero
2005-05-27 16:07 ` Stefan Monnier [this message]
2005-05-27 16:45 ` Drew Adams
2005-05-27 23:37 ` Juanma Barranquero
2005-05-27 14:20 ` Richard Stallman
2005-05-27 15:12 ` Lute Kamstra
2005-05-27 21:43 ` Miles Bader
2005-05-27 23:48 ` Katsumi Yamaoka
2005-05-30 6:45 ` Katsumi Yamaoka
2005-05-31 4:17 ` Richard Stallman
2005-05-28 11:52 ` Richard Stallman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvvf548xjs.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@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.
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.