(cl-defsubst): Ignore false-positive occurrences of args via &cl-defs

Fixes: debbugs:20149

* lisp/emacs-lisp/cl-macs.el (cl-defsubst): Ignore false-positive
occurrences of args via &cl-defs.
This commit is contained in:
Stefan Monnier 2015-03-20 16:29:21 -04:00
parent 932d0fdb4f
commit 4cd31cf019
2 changed files with 7 additions and 1 deletions

View file

@ -2446,10 +2446,11 @@ The function's arguments should be treated as immutable.
\(fn NAME ARGLIST [DOCSTRING] BODY...)"
(declare (debug cl-defun) (indent 2))
(let* ((argns (cl--arglist-args args))
(real-args (if (eq '&cl-defs (car args)) (cddr args) args))
(p argns)
;; (pbody (cons 'progn body))
)
(while (and p (eq (cl--expr-contains args (car p)) 1)) (pop p))
(while (and p (eq (cl--expr-contains real-args (car p)) 1)) (pop p))
`(progn
,(if p nil ; give up if defaults refer to earlier args
`(cl-define-compiler-macro ,name