mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-07 06:50:23 -08:00
* 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.
This commit is contained in:
parent
d308026462
commit
ced10a4c9f
5 changed files with 68 additions and 29 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue