From 13d6e8fa54843b0b087e5a9c266e4b7e0d709c3f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 16 Oct 2022 12:01:47 -0400 Subject: cl-generic: Fix `advertised-calling-convention` declarations * lisp/emacs-lisp/cl-generic.el (cl-generic-define-method): Preserve the `advertised-calling-convention`, if any (bug#58563). * lisp/subr.el (declare): Warn when we hit this. * lisp/emacs-lisp/byte-run.el (get-advertised-calling-convention): New fun. * lisp/progmodes/elisp-mode.el (elisp-get-fnsym-args-string): * lisp/help-fns.el (help-fns--signature): * lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition): Use it. * test/lisp/emacs-lisp/cl-generic-tests.el (cl-generic-tests--acc): New fun. (cl-generic-tests--advertised-calling-convention-bug58563): New test. --- lisp/emacs-lisp/byte-run.el | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lisp/emacs-lisp/byte-run.el') diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 9db84c31b88..a33808ab92d 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -481,6 +481,11 @@ convention was modified." (puthash (indirect-function function) signature advertised-signature-table)) +(defun get-advertised-calling-convention (function) + "Get the advertised SIGNATURE of FUNCTION. +Return t if there isn't any." + (gethash function advertised-signature-table t)) + (defun make-obsolete (obsolete-name current-name when) "Make the byte-compiler warn that function OBSOLETE-NAME is obsolete. OBSOLETE-NAME should be a function name or macro name (a symbol). -- cgit v1.2.3