]> git.eshelyaron.com Git - emacs.git/commitdiff
(Declaring Functions): Add optional fourth
authorGlenn Morris <rgm@gnu.org>
Fri, 30 Nov 2007 07:51:41 +0000 (07:51 +0000)
committerGlenn Morris <rgm@gnu.org>
Fri, 30 Nov 2007 07:51:41 +0000 (07:51 +0000)
argument of declare-function, setting third argument to `t'.

doc/lispref/ChangeLog
doc/lispref/functions.texi

index afb7b289da14ae2d87730bce08b97ead03f43ebc..f99b5ba2a2a0a826e11722e5d061422d42bb850b 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-30  Glenn Morris  <rgm@gnu.org>
+
+       * functions.texi (Declaring Functions): Add optional fourth
+       argument of declare-function, and setting third argument to `t'.
+
 2007-11-29  Glenn Morris  <rgm@gnu.org>
 
        * functions.texi (Declaring Functions): Add findex.  Mention
index b6f209c16d27cd4b1151691e8f9842339336fc45..1cd60f9009bed7def644ed22cc2f7a293e738786 100644 (file)
@@ -1266,10 +1266,11 @@ cases, this might be something like @code{(file &optional overwrite)}.
 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 @@ If you prefix the filename in the @code{declare-function} statement with
 @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