From 9c1f24d7a497ee8b9c1ec3f1161a3ed7d6e34bd0 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 3 Dec 2023 14:22:48 -0500 Subject: [PATCH] * lisp/emacs-lisp/macroexp.el (macroexp-parse-body): Fix bug#67568 This fixes a regression introduced in commit f616edb4ccce. --- lisp/emacs-lisp/macroexp.el | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) 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) -- 2.39.2