]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bootstrap further
authorEshel Yaron <me@eshelyaron.com>
Thu, 24 Oct 2024 12:06:51 +0000 (14:06 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Oct 2024 12:06:51 +0000 (14:06 +0200)
lisp/emacs-lisp/byte-opt.el
lisp/emacs-lisp/macroexp.el

index 0e02ed8c736ba4bc2162e127253dbd23573611b2..5bc444f5abaa56f461082d4e429b3a3f2a6b15af 100644 (file)
@@ -752,28 +752,6 @@ If this function returns nil, then FORM never returns."
 ;; This implies that you cannot simply destructively modify the list;
 ;; you must return something not EQ to it if you make an optimization.
 
-(defsubst byte-opt--bool-value-form (form)
-  "The form in FORM that yields its boolean value, possibly FORM itself."
-  (while (let ((head (car-safe form)))
-           (cond ((memq head '( progn inline save-excursion save-restriction
-                                save-current-buffer))
-                  (setq form (car (last (cdr form))))
-                  t)
-                 ((memq head '(let let*))
-                  (setq form (car (last (cddr form))))
-                  t)
-                 ((memq head '( prog1 unwind-protect copy-sequence identity
-                                reverse nreverse sort))
-                  (setq form (nth 1 form))
-                  t)
-                 ((memq head '(mapc setq setcar setcdr puthash set))
-                  (setq form (nth 2 form))
-                  t)
-                 ((memq head '(aset put function-put))
-                  (setq form (nth 3 form))
-                  t))))
-  form)
-
 ;; If the function is being called with constant integer args,
 ;; evaluate as much as possible at compile-time.  This optimizer
 ;; assumes that the function is associative, like min or max.
index fbfcde587694bdf391ec1c9ea7d7b473a376e91f..99cd816b51a33e8874ce190fd3e6f498464be1b1 100644 (file)
@@ -838,6 +838,28 @@ test of free variables in the following ways:
        (error "Eager macro-expansion failure: %S" err)
        form)))))
 
+(defsubst byte-opt--bool-value-form (form)
+  "The form in FORM that yields its boolean value, possibly FORM itself."
+  (while (let ((head (car-safe form)))
+           (cond ((memq head '( progn inline save-excursion save-restriction
+                                save-current-buffer))
+                  (setq form (car (last (cdr form))))
+                  t)
+                 ((memq head '(let let*))
+                  (setq form (car (last (cddr form))))
+                  t)
+                 ((memq head '( prog1 unwind-protect copy-sequence identity
+                                reverse nreverse sort))
+                  (setq form (nth 1 form))
+                  t)
+                 ((memq head '(mapc setq setcar setcdr puthash set))
+                  (setq form (nth 2 form))
+                  t)
+                 ((memq head '(aset put function-put))
+                  (setq form (nth 3 form))
+                  t))))
+  form)
+
 (defun byte-compile-trueconstp (form)
   "Return non-nil if FORM always evaluates to a non-nil value."
   (setq form (byte-opt--bool-value-form form))