aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2007-11-17 03:45:17 +0000
committerGlenn Morris2007-11-17 03:45:17 +0000
commitaefbd1608c5aca54cc04306792f7d10915fb8006 (patch)
tree009a902e7b4e4c95390b992401a6d683c865d273
parent43ab13de0b74f3d9f27797d8cad877b0ab478499 (diff)
downloademacs-aefbd1608c5aca54cc04306792f7d10915fb8006.tar.gz
emacs-aefbd1608c5aca54cc04306792f7d10915fb8006.zip
(declare-function): New macro.
-rw-r--r--lisp/emacs-lisp/byte-run.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 267173c1713..b0525cbc7c6 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -103,6 +103,25 @@ The return value of this function is not used."
103 (eval-and-compile 103 (eval-and-compile
104 (put ',name 'byte-optimizer 'byte-compile-inline-expand)))) 104 (put ',name 'byte-optimizer 'byte-compile-inline-expand))))
105 105
106(defmacro declare-function (fn file &optional arglist)
107 "Tell the byte-compiler that function FN is defined, in FILE.
108Optional ARGLIST is the argument list used by the function. The
109FILE argument is not used by the byte-compiler, but by the
110`check-declare' package, which checks that FILE contains a
111definition for FN. FILE should be either absolute, or relative
112to the location of the file containing the declaration. ARGLIST
113is used by both the byte-compiler and `check-declare' to check
114for consistency.
115
116Note that for the purposes of `check-declare', this statement
117must be the first non-whitespace on a line, and everything up to
118the end of FILE must be all on the same line. For example:
119
120\(declare-function c-end-of-defun \"progmodes/cc-cmds.el\"
121 \(&optional arg))"
122 ;; Does nothing - byte-compile-declare-function does the work.
123 )
124
106(defun make-obsolete (obsolete-name current-name &optional when) 125(defun make-obsolete (obsolete-name current-name &optional when)
107 "Make the byte-compiler warn that OBSOLETE-NAME is obsolete. 126 "Make the byte-compiler warn that OBSOLETE-NAME is obsolete.
108The warning will say that CURRENT-NAME should be used instead. 127The warning will say that CURRENT-NAME should be used instead.