(disassemble-internal): Handle new function values

* lisp/emacs-lisp/disass.el (disassemble-internal): Fix the
`interpreted-function` case.
This commit is contained in:
Stefan Monnier 2024-04-29 13:47:15 -04:00
parent 7c835291dd
commit ccb49acd2a

View 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)