From 68de70a158a0a0554abb399148900e8daee53c54 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 29 Apr 2024 13:47:15 -0400 Subject: [PATCH] (disassemble-internal): Handle new function values * lisp/emacs-lisp/disass.el (disassemble-internal): Fix the `interpreted-function` case. (cherry picked from commit ccb49acd2afb8cec9cec1afba16e16420b9f9261) --- lisp/emacs-lisp/disass.el | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el index 15caee9b29c..60881ab176b 100644 --- a/lisp/emacs-lisp/disass.el +++ b/lisp/emacs-lisp/disass.el @@ -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 "(...)\n") (mapc ;Recurse on list of byte-code objects. (lambda (obj) -- 2.39.5