]> git.eshelyaron.com Git - emacs.git/commitdiff
(disassemble-internal): Handle new function values
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 29 Apr 2024 17:47:15 +0000 (13:47 -0400)
committerEshel Yaron <me@eshelyaron.com>
Mon, 29 Apr 2024 19:48:34 +0000 (21:48 +0200)
* lisp/emacs-lisp/disass.el (disassemble-internal): Fix the
`interpreted-function` case.

(cherry picked from commit ccb49acd2afb8cec9cec1afba16e16420b9f9261)

lisp/emacs-lisp/disass.el

index 15caee9b29c4c7cf3838d8853d0ea09c834cc233..60881ab176b884205f2453f5110801903309675f 100644 (file)
@@ -115,16 +115,14 @@ redefine OBJECT if it is a symbol."
              obj (cdr obj)))
     (if (eq (car-safe obj) 'byte-code)
        (setq obj `(lambda () ,obj)))
-    (when (consp obj)
+    (when (or (consp obj) (interpreted-function-p obj))
       (unless (functionp obj) (error "Not a function"))
-      (if (assq 'byte-code obj)
-          nil
-        (if interactive-p (message (if name
-                                       "Compiling %s's definition..."
-                                     "Compiling definition...")
-                                   name))
-        (setq obj (byte-compile obj))
-        (if interactive-p (message "Done compiling.  Disassembling..."))))
+      (if interactive-p (message (if name
+                                     "Compiling %s's definition..."
+                                   "Compiling definition...")
+                                 name))
+      (setq obj (byte-compile obj))
+      (if interactive-p (message "Done compiling.  Disassembling...")))
     (cond ((consp obj)
           (setq args (help-function-arglist obj))      ;save arg list
           (setq obj (cdr obj))         ;throw lambda away
@@ -171,9 +169,7 @@ redefine OBJECT if it is a symbol."
              (let ((print-escape-newlines t))
                (prin1 interactive (current-buffer))))
            (insert "\n"))))
-    (cond ((and (consp obj) (assq 'byte-code obj))
-          (disassemble-1 (assq 'byte-code obj) indent))
-         ((byte-code-function-p obj)
+    (cond ((byte-code-function-p obj)
           (disassemble-1 obj indent))
          (t
           (insert "Uncompiled body:  ")
@@ -279,6 +275,8 @@ OBJ should be a call to BYTE-CODE generated by the byte compiler."
                         arg
                         (+ indent disassemble-recursive-indent)))
                       ((eq (car-safe (car-safe arg)) 'byte-code)
+                       ;; FIXME: I'm 99% sure bytecomp never generates
+                       ;; this any more.
                        (insert "(<byte code>...)\n")
                        (mapc      ;Recurse on list of byte-code objects.
                         (lambda (obj)