]> git.eshelyaron.com Git - emacs.git/commitdiff
(disassemble): Fix case of `(byte-code ...)` argument
authorAndrea Corallo <acorallo@gnu.org>
Wed, 1 May 2024 18:14:01 +0000 (14:14 -0400)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:31:02 +0000 (18:31 +0200)
* lisp/emacs-lisp/disass.el (disassemble): Handle (byte-code ...) here..
(disassemble-internal): ...instead of here.
(disassemble-1): Adjust text to reflect the existence of other
compiled functions.

(cherry picked from commit 468f3f1cb44b8807c49add4235af3fe20ea7a73b)

lisp/emacs-lisp/disass.el

index 60881ab176b884205f2453f5110801903309675f..9142716613768e5b79be1fa3824050ea337bb2b5 100644 (file)
@@ -64,8 +64,11 @@ redefine OBJECT if it is a symbol."
                                     obarray 'fboundp t nil nil def))
            nil 0 t)))
   (let ((lb lexical-binding))
-    (if (and (consp object) (not (functionp object)))
-        (setq object `(lambda () ,object)))
+    (when (and (consp object) (not (eq (car object) 'lambda)))
+      (setq object
+            (if (eq (car object) 'byte-code)
+                (apply #'make-byte-code 0 (cdr object))
+              `(lambda () ,object))))
     (or indent (setq indent 0))                ;Default indent to zero
     (save-excursion
       (if (or interactive-p (null buffer))
@@ -113,8 +116,6 @@ redefine OBJECT if it is a symbol."
     (if (eq (car-safe obj) 'macro)     ;Handle macros.
        (setq macro t
              obj (cdr obj)))
-    (if (eq (car-safe obj) 'byte-code)
-       (setq obj `(lambda () ,obj)))
     (when (or (consp obj) (interpreted-function-p obj))
       (unless (functionp obj) (error "Not a function"))
       (if interactive-p (message (if name
@@ -263,7 +264,7 @@ OBJ should be a call to BYTE-CODE generated by the byte compiler."
                            (and (eq (car-safe arg) 'macro)
                                 (byte-code-function-p (cdr arg))))
                        (cond ((byte-code-function-p arg)
-                              (insert "<compiled-function>\n"))
+                              (insert "<byte-code-function>\n"))
                              (t (insert "<compiled macro>\n")))
                        (disassemble-internal
                         arg