emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 9c1f24d7a49: * lisp/emacs-lisp/macroexp.el (macroexp-parse-body):


From: Stefan Monnier
Subject: master 9c1f24d7a49: * lisp/emacs-lisp/macroexp.el (macroexp-parse-body): Fix bug#67568
Date: Sun, 3 Dec 2023 14:23:00 -0500 (EST)

branch: master
commit 9c1f24d7a497ee8b9c1ec3f1161a3ed7d6e34bd0
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]