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.
This commit is contained in:
parent
4685eddb66
commit
f653e20407
1 changed files with 7 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue