From 16c9c10f0ffeabcd838ced945dbb9da819899345 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 22 Jan 1998 02:26:48 +0000 Subject: [PATCH] (define-compiler-macro): Handle empty arglist. --- lisp/emacs-lisp/cl-macs.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 37d02b564cb..e6656a168b1 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2440,9 +2440,9 @@ compiler macros are expanded repeatedly until no further expansions are possible. Unlike regular macros, BODY can decide to \"punt\" and leave the original function call alone by declaring an initial `&whole foo' parameter and then returning foo." - (let ((p (if (listp args) args (list '&rest args))) (res nil)) + (let ((p args) (res nil)) (while (consp p) (cl-push (cl-pop p) res)) - (setq args (nreverse res)) (setcdr res (and p (list '&rest p)))) + (setq args (nconc (nreverse res) (and p (list '&rest p))))) (list 'eval-when '(compile load eval) (cl-transform-function-property func 'cl-compiler-macro -- 2.39.2