aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-12-03 00:33:35 +0000
committerRichard M. Stallman2007-12-03 00:33:35 +0000
commit708bb6f8849a4e4fac349ae19379ff41f46c067c (patch)
tree711940127d6528b7f1eb28d6baeb3a4c09438a26
parente9fa6d0a4c565561c028b226237cdc58032da6e4 (diff)
downloademacs-708bb6f8849a4e4fac349ae19379ff41f46c067c.tar.gz
emacs-708bb6f8849a4e4fac349ae19379ff41f46c067c.zip
(declare-function): Moved from byte-run.el.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/subr.el36
2 files changed, 40 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 373eead8fdc..2745a811c29 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12007-12-03 Richard Stallman <rms@gnu.org> 12007-12-03 Richard Stallman <rms@gnu.org>
2 2
3 * subr.el (declare-function): Moved from byte-run.el.
4
5 * emacs-lisp/byte-run.el (declare-function): Moved to subr.el
6
3 * window.el (recenter-top-bottom): Don't use `ecase'. 7 * window.el (recenter-top-bottom): Don't use `ecase'.
4 8
52007-12-02 Karl Fogel <kfogel@red-bean.com> 92007-12-02 Karl Fogel <kfogel@red-bean.com>
diff --git a/lisp/subr.el b/lisp/subr.el
index 59be9164b60..3461700d6cb 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -36,6 +36,42 @@ Each element of this list holds the arguments to one call to `defcustom'.")
36 (setq custom-declare-variable-list 36 (setq custom-declare-variable-list
37 (cons arguments custom-declare-variable-list))) 37 (cons arguments custom-declare-variable-list)))
38 38
39(defmacro declare-function (fn file &optional arglist fileonly)
40 "Tell the byte-compiler that function FN is defined, in FILE.
41Optional ARGLIST is the argument list used by the function. The
42FILE argument is not used by the byte-compiler, but by the
43`check-declare' package, which checks that FILE contains a
44definition for FN. ARGLIST is used by both the byte-compiler and
45`check-declare' to check for consistency.
46
47FILE can be either a Lisp file (in which case the \".el\"
48extension is optional), or a C file. C files are expanded
49relative to the Emacs \"src/\" directory. Lisp files are
50searched for using `locate-library', and if that fails they are
51expanded relative to the location of the file containing the
52declaration. A FILE with an \"ext:\" prefix is an external file.
53`check-declare' will check such files if they are found, and skip
54them without error if they are not.
55
56FILEONLY non-nil means that `check-declare' will only check that
57FILE exists, not that it defines FN. This is intended for
58function-definitions that `check-declare' does not recognize, e.g.
59`defstruct'.
60
61To specify a value for FILEONLY without passing an argument list,
62set ARGLIST to `t'. This is necessary because `nil' means an
63empty argument list, rather than an unspecified one.
64
65Note that for the purposes of `check-declare', this statement
66must be the first non-whitespace on a line, and everything up to
67the end of FILE must be all on the same line. For example:
68
69\(declare-function c-end-of-defun \"progmodes/cc-cmds.el\"
70 \(&optional arg))
71
72For more information, see Info node `elisp(Declaring Functions)'."
73 ;; Does nothing - byte-compile-declare-function does the work.
74 nil)
39 75
40;;;; Basic Lisp macros. 76;;;; Basic Lisp macros.
41 77