diff options
| author | Glenn Morris | 2007-11-30 07:51:41 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-11-30 07:51:41 +0000 |
| commit | 8f4b37d892ab777b6d4a1715e3cb8acf679e978f (patch) | |
| tree | a677d64f347b6bf70fa2202cabb7d570c029346b | |
| parent | 8fff8988e612e861e1d9be9e624823013dcb8850 (diff) | |
| download | emacs-8f4b37d892ab777b6d4a1715e3cb8acf679e978f.tar.gz emacs-8f4b37d892ab777b6d4a1715e3cb8acf679e978f.zip | |
(Declaring Functions): Add optional fourth
argument of declare-function, setting third argument to `t'.
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/functions.texi | 13 |
2 files changed, 16 insertions, 2 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index afb7b289da1..f99b5ba2a2a 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-11-30 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * functions.texi (Declaring Functions): Add optional fourth | ||
| 4 | argument of declare-function, and setting third argument to `t'. | ||
| 5 | |||
| 1 | 2007-11-29 Glenn Morris <rgm@gnu.org> | 6 | 2007-11-29 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * functions.texi (Declaring Functions): Add findex. Mention | 8 | * functions.texi (Declaring Functions): Add findex. Mention |
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index b6f209c16d2..1cd60f9009b 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi | |||
| @@ -1266,10 +1266,11 @@ cases, this might be something like @code{(file &optional overwrite)}. | |||
| 1266 | You don't have to specify the argument list, but if you do the | 1266 | You don't have to specify the argument list, but if you do the |
| 1267 | byte compiler can check that the calls match the declaration. | 1267 | byte compiler can check that the calls match the declaration. |
| 1268 | 1268 | ||
| 1269 | @defmac declare-function function file arglist | 1269 | @defmac declare-function function file &optional arglist fileonly |
| 1270 | Tell the byte compiler to assume that @var{function} is defined, with | 1270 | Tell the byte compiler to assume that @var{function} is defined, with |
| 1271 | arguments @var{arglist}, and that the definition should come from | 1271 | arguments @var{arglist}, and that the definition should come from |
| 1272 | the file @var{file}. | 1272 | the file @var{file}. @var{fileonly} non-nil means only check that |
| 1273 | @var{file} exists, not that it actually defines @var{function}. | ||
| 1273 | @end defmac | 1274 | @end defmac |
| 1274 | 1275 | ||
| 1275 | To verify that these functions really are declared where | 1276 | 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 | |||
| 1295 | @samp{ext:}, then it will be checked if it is found, otherwise skipped | 1296 | @samp{ext:}, then it will be checked if it is found, otherwise skipped |
| 1296 | without error. | 1297 | without error. |
| 1297 | 1298 | ||
| 1299 | There are some function definitions that @samp{check-declare} does not | ||
| 1300 | understand (e.g. @code{defstruct} and some other macros). In such cases, | ||
| 1301 | you can pass a non-@code{nil} fourth argument to @code{declare-function}, | ||
| 1302 | meaning to only check that the file exists, not that it actually defines | ||
| 1303 | the function. Note that to do this without having to specify an | ||
| 1304 | argument list, you should set the third argument to @code{t} (because | ||
| 1305 | @code{nil} means an empty argument list, as opposed to an unspecified one). | ||
| 1306 | |||
| 1298 | @node Function Safety | 1307 | @node Function Safety |
| 1299 | @section Determining whether a Function is Safe to Call | 1308 | @section Determining whether a Function is Safe to Call |
| 1300 | @cindex function safety | 1309 | @cindex function safety |