emacs-diffs
[Top][All Lists]
Advanced

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

scratch/faster-loaddefs f8500742a4 6/7: Fix autoload (progn ...)


From: Lars Ingebrigtsen
Subject: scratch/faster-loaddefs f8500742a4 6/7: Fix autoload (progn ...)
Date: Sat, 28 May 2022 12:31:22 -0400 (EDT)

branch: scratch/faster-loaddefs
commit f8500742a47092de8bd7de442d5fd1ba618e046b
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix autoload (progn ...)
---
 lisp/emacs-lisp/loaddefs-gen.el | 36 +++++++++++++++---------------------
 1 file changed, 15 insertions(+), 21 deletions(-)

diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
index 2c50fa994f..9c7618ceb7 100644
--- a/lisp/emacs-lisp/loaddefs-gen.el
+++ b/lisp/emacs-lisp/loaddefs-gen.el
@@ -112,27 +112,21 @@ If PACKAGE-ONLY, only return the package info."
                                  (read (current-buffer))
                                (unless (bolp)
                                  (forward-line 1))))
-                       (autoload (make-autoload form load-name)))
-                  (if (not autoload)
-                      ;; It's was not transformed to an autoload spec;
-                      ;; add as is.
-                      (push (list to-file file
-                                  (loaddefs-gen--prettify-autoload form))
-                            defs)
-                    ;; We get back either an autoload form, or a tree
-                    ;; structure of `(progn ...)' things, so unravel that.
-                    (let ((forms (if (eq (car autoload) 'progn)
-                                     (cdr autoload)
-                                   (list autoload))))
-                      (while forms
-                        (let ((elem (pop forms)))
-                          (if (eq (car elem) 'progn)
-                              ;; More recursion; add it to the start.
-                              (setq forms (nconc (cdr elem) forms))
-                            ;; We have something to add to the defs; do it.
-                            (push (list to-file file
-                                        (loaddefs-gen--prettify-autoload elem))
-                                  defs)))))))
+                       (autoload (or (make-autoload form load-name) form)))
+                  ;; We get back either an autoload form, or a tree
+                  ;; structure of `(progn ...)' things, so unravel that.
+                  (let ((forms (if (eq (car autoload) 'progn)
+                                   (cdr autoload)
+                                 (list autoload))))
+                    (while forms
+                      (let ((elem (pop forms)))
+                        (if (eq (car elem) 'progn)
+                            ;; More recursion; add it to the start.
+                            (setq forms (nconc (cdr elem) forms))
+                          ;; We have something to add to the defs; do it.
+                          (push (list to-file file
+                                      (loaddefs-gen--prettify-autoload elem))
+                                defs))))))
               ;; Just put the rest of the line into the loaddefs.
               ;; FIXME: We skip the first space if there's more
               ;; whitespace after.



reply via email to

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