From: Stefan Monnier Date: Sun, 3 Dec 2023 19:22:48 +0000 (-0500) Subject: * lisp/emacs-lisp/macroexp.el (macroexp-parse-body): Fix bug#67568 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9c1f24d7a497ee8b9c1ec3f1161a3ed7d6e34bd0;p=emacs.git * lisp/emacs-lisp/macroexp.el (macroexp-parse-body): Fix bug#67568 This fixes a regression introduced in commit f616edb4ccce. --- diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 6eb670d6dc1..615a6622ce6 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -533,17 +533,18 @@ definitions to shadow the loaded ones for use in file byte-compilation." (defun macroexp-parse-body (body) "Parse a function BODY into (DECLARATIONS . EXPS)." (let ((decls ())) - ;; If there is only a string literal with nothing following, we - ;; consider this to be part of the body (the return value) rather - ;; than a declaration at this point. - (unless (and (null (cdr body)) (stringp (car body))) - (while - (and body - (let ((e (car body))) - (or (stringp e) - (memq (car-safe e) - '(:documentation declare interactive cl-declare))))) - (push (pop body) decls))) + (while + (and body + (let ((e (car body))) + (or (and (stringp e) + ;; If there is only a string literal with + ;; nothing following, we consider this to be + ;; part of the body (the return value) rather + ;; than a declaration at this point. + (cdr body)) + (memq (car-safe e) + '(:documentation declare interactive cl-declare))))) + (push (pop body) decls)) (cons (nreverse decls) body))) (defun macroexp-progn (exps)