aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2007-11-17 03:46:23 +0000
committerGlenn Morris2007-11-17 03:46:23 +0000
commitd97362d77951e32486aff2ed7005f8b9b047555c (patch)
tree2fe42851b5fe5dd2bd1ed7e63bfb3195fbec04bd
parentaefbd1608c5aca54cc04306792f7d10915fb8006 (diff)
downloademacs-d97362d77951e32486aff2ed7005f8b9b047555c.tar.gz
emacs-d97362d77951e32486aff2ed7005f8b9b047555c.zip
(byte-compile-declare-function): New function, byte-hunk-handler for
declare-function. (byte-compile-callargs-warn): Handle declared functions.
-rw-r--r--lisp/emacs-lisp/bytecomp.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 0248bb20f06..313df65f0c1 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1258,7 +1258,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
1258 (byte-compile-fdefinition (car form) t))) 1258 (byte-compile-fdefinition (car form) t)))
1259 (sig (if (and def (not (eq def t))) 1259 (sig (if (and def (not (eq def t)))
1260 (byte-compile-arglist-signature 1260 (byte-compile-arglist-signature
1261 (if (eq 'lambda (car-safe def)) 1261 (if (memq (car-safe def) '(declared lambda))
1262 (nth 1 def) 1262 (nth 1 def)
1263 (if (byte-code-function-p def) 1263 (if (byte-code-function-p def)
1264 (aref def 0) 1264 (aref def 0)
@@ -2817,6 +2817,16 @@ If FORM is a lambda or a macro, byte-compile it as a function."
2817 (cdr body)) 2817 (cdr body))
2818 (body 2818 (body
2819 (list body)))) 2819 (list body))))
2820
2821(put 'declare-function 'byte-hunk-handler 'byte-compile-declare-function)
2822(defun byte-compile-declare-function (form)
2823 (push (cons (nth 1 form)
2824 (if (< (length form) 4) ; arglist not specified
2825 t
2826 (list 'declared (nth 3 form))))
2827 byte-compile-function-environment)
2828 nil)
2829
2820 2830
2821;; This is the recursive entry point for compiling each subform of an 2831;; This is the recursive entry point for compiling each subform of an
2822;; expression. 2832;; expression.