From: Andrea Corallo Date: Wed, 1 May 2024 18:14:01 +0000 (-0400) Subject: (disassemble): Fix case of `(byte-code ...)` argument X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b3725c0215b4d7176352f873df65a1593aef2479;p=emacs.git (disassemble): Fix case of `(byte-code ...)` argument * 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) --- diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el index 60881ab176b..91427166137 100644 --- a/lisp/emacs-lisp/disass.el +++ b/lisp/emacs-lisp/disass.el @@ -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 "\n")) + (insert "\n")) (t (insert "\n"))) (disassemble-internal arg