diff options
| author | Richard M. Stallman | 2007-12-03 00:33:35 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2007-12-03 00:33:35 +0000 |
| commit | 708bb6f8849a4e4fac349ae19379ff41f46c067c (patch) | |
| tree | 711940127d6528b7f1eb28d6baeb3a4c09438a26 | |
| parent | e9fa6d0a4c565561c028b226237cdc58032da6e4 (diff) | |
| download | emacs-708bb6f8849a4e4fac349ae19379ff41f46c067c.tar.gz emacs-708bb6f8849a4e4fac349ae19379ff41f46c067c.zip | |
(declare-function): Moved from byte-run.el.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/subr.el | 36 |
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 @@ | |||
| 1 | 2007-12-03 Richard Stallman <rms@gnu.org> | 1 | 2007-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 | ||
| 5 | 2007-12-02 Karl Fogel <kfogel@red-bean.com> | 9 | 2007-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. | ||
| 41 | Optional ARGLIST is the argument list used by the function. The | ||
| 42 | FILE argument is not used by the byte-compiler, but by the | ||
| 43 | `check-declare' package, which checks that FILE contains a | ||
| 44 | definition for FN. ARGLIST is used by both the byte-compiler and | ||
| 45 | `check-declare' to check for consistency. | ||
| 46 | |||
| 47 | FILE can be either a Lisp file (in which case the \".el\" | ||
| 48 | extension is optional), or a C file. C files are expanded | ||
| 49 | relative to the Emacs \"src/\" directory. Lisp files are | ||
| 50 | searched for using `locate-library', and if that fails they are | ||
| 51 | expanded relative to the location of the file containing the | ||
| 52 | declaration. A FILE with an \"ext:\" prefix is an external file. | ||
| 53 | `check-declare' will check such files if they are found, and skip | ||
| 54 | them without error if they are not. | ||
| 55 | |||
| 56 | FILEONLY non-nil means that `check-declare' will only check that | ||
| 57 | FILE exists, not that it defines FN. This is intended for | ||
| 58 | function-definitions that `check-declare' does not recognize, e.g. | ||
| 59 | `defstruct'. | ||
| 60 | |||
| 61 | To specify a value for FILEONLY without passing an argument list, | ||
| 62 | set ARGLIST to `t'. This is necessary because `nil' means an | ||
| 63 | empty argument list, rather than an unspecified one. | ||
| 64 | |||
| 65 | Note that for the purposes of `check-declare', this statement | ||
| 66 | must be the first non-whitespace on a line, and everything up to | ||
| 67 | the 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 | |||
| 72 | For 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 | ||