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"
|
(setq docstring (format "THIS FUNCTION DOES NOTHING BECAUSE %s IS DISABLED\n\n%s"
|
||||||
origin docstring))
|
origin docstring))
|
||||||
(condition-case-unless-debug e
|
(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
|
(cl-loop for arg in arglist
|
||||||
if (and (symbolp arg)
|
if (and (symbolp arg)
|
||||||
(not (keywordp arg))
|
(not (keywordp arg))
|
||||||
(not (memq arg cl--lambda-list-keywords)))
|
(not (memq arg cl--lambda-list-keywords)))
|
||||||
collect (list 'ignore arg)
|
collect arg into syms
|
||||||
else if (listp arg)
|
else if (listp arg)
|
||||||
collect (list 'ignore (car arg))))
|
collect (car arg) into syms
|
||||||
|
finally return (if syms `((ignore ,@syms)))))
|
||||||
('error
|
('error
|
||||||
(message "Ignoring autodef %s (%s)"
|
(message "Ignoring autodef %s (%s)"
|
||||||
name e)
|
name e)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue