From ced10a4c9f0030e4e554d6ca3f96c6e366dba8db Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 1 Oct 2009 16:54:21 +0000 Subject: * emacs-lisp/byte-run.el (advertised-signature-table): New var. (set-advertised-calling-convention): New function. (make-obsolete, define-obsolete-function-alias) (make-obsolete-variable, define-obsolete-variable-alias): Make the optional-ness of `when' obsolete. (define-obsolete-face-alias): Make `when' non-optional. * help-fns.el (help-function-arglist): * emacs-lisp/bytecomp.el (byte-compile-fdefinition): Use advertised-signature-table. --- lisp/emacs-lisp/bytecomp.el | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'lisp/emacs-lisp/bytecomp.el') diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 79e0885137b..f411576c883 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1230,11 +1230,11 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." ;;; sanity-checking arglists -;; If a function has an entry saying (FUNCTION . t). -;; that means we know it is defined but we don't know how. -;; If a function has an entry saying (FUNCTION . nil), -;; that means treat it as not defined. (defun byte-compile-fdefinition (name macro-p) + ;; If a function has an entry saying (FUNCTION . t). + ;; that means we know it is defined but we don't know how. + ;; If a function has an entry saying (FUNCTION . nil), + ;; that means treat it as not defined. (let* ((list (if macro-p byte-compile-macro-environment byte-compile-function-environment)) @@ -1248,16 +1248,18 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (and (not macro-p) (byte-code-function-p (symbol-function fn))))) (setq fn (symbol-function fn))) - (if (and (not macro-p) (byte-code-function-p fn)) - fn - (and (consp fn) - (if (eq 'macro (car fn)) - (cdr fn) - (if macro-p - nil - (if (eq 'autoload (car fn)) - nil - fn))))))))) + (let ((advertised (gethash fn advertised-signature-table t))) + (cond + ((listp advertised) + (if macro-p + `(macro lambda ,advertised) + `(lambda ,advertised))) + ((and (not macro-p) (byte-code-function-p fn)) fn) + ((not (consp fn)) nil) + ((eq 'macro (car fn)) (cdr fn)) + (macro-p nil) + ((eq 'autoload (car fn)) nil) + (t fn))))))) (defun byte-compile-arglist-signature (arglist) (let ((args 0) -- cgit v1.2.3