From f653e20407e7bd72a4f5170c157a8f4dc49eb3b0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 18 Jun 2018 17:30:33 +0200 Subject: [PATCH] Fix disabled autodefs defined with cl-lib Stubs are defined as ordinary macros (with defmacro), but if an autodef is defined with cl-defun, defmacro can't handle the clisp-style argument lists, causing wrong-number-of-arguments errors. --- core/core-dispatcher.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/core-dispatcher.el b/core/core-dispatcher.el index 1f45166fe..53ce5453f 100644 --- a/core/core-dispatcher.el +++ b/core/core-dispatcher.el @@ -457,14 +457,18 @@ even if it doesn't need reloading!" (setq docstring (format "THIS FUNCTION DOES NOTHING BECAUSE %s IS DISABLED\n\n%s" origin docstring)) (condition-case-unless-debug e - (append (list 'defmacro name arglist docstring) + (append (list (pcase type + (`defun 'defmacro) + (`cl-defun `cl-defmacro)) + name arglist docstring) (cl-loop for arg in arglist if (and (symbolp arg) (not (keywordp arg)) (not (memq arg cl--lambda-list-keywords))) - collect (list 'ignore arg) + collect arg into syms else if (listp arg) - collect (list 'ignore (car arg)))) + collect (car arg) into syms + finally return (if syms `((ignore ,@syms))))) ('error (message "Ignoring autodef %s (%s)" name e)