# HG changeset patch # User Glenn Morris # Date 1195271183 0 # Node ID fadd239185015cb14eee42b2ae62b4bedb8cb6f9 # Parent 55bc44bcdff43b071153bf2d36680f987f90de2d (byte-compile-declare-function): New function, byte-hunk-handler for declare-function. (byte-compile-callargs-warn): Handle declared functions. diff -r 55bc44bcdff4 -r fadd23918501 lisp/emacs-lisp/bytecomp.el --- a/lisp/emacs-lisp/bytecomp.el Sat Nov 17 03:45:17 2007 +0000 +++ b/lisp/emacs-lisp/bytecomp.el Sat Nov 17 03:46:23 2007 +0000 @@ -1258,7 +1258,7 @@ (byte-compile-fdefinition (car form) t))) (sig (if (and def (not (eq def t))) (byte-compile-arglist-signature - (if (eq 'lambda (car-safe def)) + (if (memq (car-safe def) '(declared lambda)) (nth 1 def) (if (byte-code-function-p def) (aref def 0) @@ -2817,6 +2817,16 @@ (cdr body)) (body (list body)))) + +(put 'declare-function 'byte-hunk-handler 'byte-compile-declare-function) +(defun byte-compile-declare-function (form) + (push (cons (nth 1 form) + (if (< (length form) 4) ; arglist not specified + t + (list 'declared (nth 3 form)))) + byte-compile-function-environment) + nil) + ;; This is the recursive entry point for compiling each subform of an ;; expression.