comparison lisp/subr.el @ 87002:c6a200c4eebd

(declare-function): Moved from byte-run.el.
author Richard M. Stallman <rms@gnu.org>
date Mon, 03 Dec 2007 00:33:30 +0000
parents 5a317f281e6c
children 107ccd98fa12 53108e6cea98
comparison
equal deleted inserted replaced
87001:f5f1ba43cab1 87002:c6a200c4eebd
34 ;; before custom.el. 34 ;; before custom.el.
35 (defun custom-declare-variable-early (&rest arguments) 35 (defun custom-declare-variable-early (&rest arguments)
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
42 (defalias 'not 'null) 78 (defalias 'not 'null)
43 79