Mercurial > emacs
changeset 86845:62955c80c79b
(Declaring Functions): Add optional fourth
argument of declare-function, setting third argument to `t'.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Fri, 30 Nov 2007 07:51:29 +0000 |
parents | 3b8dd73f973c |
children | 5cec86f67aee |
files | doc/lispref/functions.texi |
diffstat | 1 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/lispref/functions.texi Fri Nov 30 07:49:56 2007 +0000 +++ b/doc/lispref/functions.texi Fri Nov 30 07:51:29 2007 +0000 @@ -1266,10 +1266,11 @@ You don't have to specify the argument list, but if you do the byte compiler can check that the calls match the declaration. -@defmac declare-function function file arglist +@defmac declare-function function file &optional arglist fileonly Tell the byte compiler to assume that @var{function} is defined, with arguments @var{arglist}, and that the definition should come from -the file @var{file}. +the file @var{file}. @var{fileonly} non-nil means only check that +@var{file} exists, not that it actually defines @var{function}. @end defmac To verify that these functions really are declared where @@ -1295,6 +1296,14 @@ @samp{ext:}, then it will be checked if it is found, otherwise skipped without error. + There are some function definitions that @samp{check-declare} does not +understand (e.g. @code{defstruct} and some other macros). In such cases, +you can pass a non-@code{nil} fourth argument to @code{declare-function}, +meaning to only check that the file exists, not that it actually defines +the function. Note that to do this without having to specify an +argument list, you should set the third argument to @code{t} (because +@code{nil} means an empty argument list, as opposed to an unspecified one). + @node Function Safety @section Determining whether a Function is Safe to Call @cindex function safety