]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/bytecomp.el (byte-compile-make-closure): Simplify.
authorMattias EngdegÄrd <mattiase@acm.org>
Tue, 30 Apr 2024 13:20:34 +0000 (15:20 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:30:13 +0000 (18:30 +0200)
(cherry picked from commit c15d67ecfc8f586165674c289880618caf7f270e)

lisp/emacs-lisp/bytecomp.el

index 8e8fcea9b72e56b96ea683e3a650bacf84f89a8a..d9890b5c37a5b9334e220faf340c720ca834254f 100644 (file)
@@ -4191,16 +4191,13 @@ This function is never called when `lexical-binding' is nil."
          ;; Nontrivial doc string expression: create a bytecode object
          ;; from small pieces at run time.
          `(make-byte-code
-           ',(aref fun 0)         ; 15-bit form of arglist descriptor.
-           ',(aref fun 1)         ; The byte-code.
-           (vconcat (vector . ,env) ',(aref fun 2)) ; constant vector.
-           ,@(let ((rest (nthcdr 3 (mapcar (lambda (x) `',x) fun))))
-               (if docstring-exp
-                   `(,(car rest)
-                     ,(byte-run-strip-symbol-positions docstring-exp)
-                     ,@(cddr rest))
-                 rest))))
-         ))))
+           ,(aref fun 0)         ; 15-bit form of arglist descriptor.
+           ,(aref fun 1)         ; The byte-code.
+           (vconcat (vector . ,env) ,(aref fun 2))  ; constant vector
+           ,(aref fun 3)         ; max stack depth
+           ,(byte-run-strip-symbol-positions docstring-exp)
+           ;; optional interactive spec and anything else, all quoted
+           ,@(mapcar (lambda (x) `',x) (drop 5 (append fun nil)))))))))
 
 (defun byte-compile-get-closed-var (form)
   "Byte-compile the special `internal-get-closed-var' form."