comparison lisp/emacs-lisp/disass.el @ 13340:53bbedbefdb2

(disassemble-internal): Handle lazy-loaded doc strings. (disassemble-1): Handle lazy-loaded bytecode objects.
author Richard M. Stallman <rms@gnu.org>
date Mon, 30 Oct 1995 19:22:23 +0000
parents 74218ea236fe
children 83f275dcd93a
comparison
equal deleted inserted replaced
13339:13b7b667b18f 13340:53bbedbefdb2
112 (if (or macro name) " for" "") 112 (if (or macro name) " for" "")
113 (if macro " macro" "") 113 (if macro " macro" "")
114 (if name (format " %s" name) ""))))) 114 (if name (format " %s" name) "")))))
115 (let ((doc (if (consp obj) 115 (let ((doc (if (consp obj)
116 (and (stringp (car obj)) (car obj)) 116 (and (stringp (car obj)) (car obj))
117 (and (> (length obj) 4) (aref obj 4))))) 117 ;; Use documentation to get lazy-loaded doc string
118 (documentation obj t))))
118 (if (and doc (stringp doc)) 119 (if (and doc (stringp doc))
119 (progn (and (consp obj) (setq obj (cdr obj))) 120 (progn (and (consp obj) (setq obj (cdr obj)))
120 (indent-to indent) 121 (indent-to indent)
121 (princ " doc: " (current-buffer)) 122 (princ " doc: " (current-buffer))
122 (if (string-match "\n" doc) 123 (if (string-match "\n" doc)
164 OBJ should be a call to BYTE-CODE generated by the byte compiler." 165 OBJ should be a call to BYTE-CODE generated by the byte compiler."
165 (let (bytes constvec) 166 (let (bytes constvec)
166 (if (consp obj) 167 (if (consp obj)
167 (setq bytes (car (cdr obj)) ;the byte code 168 (setq bytes (car (cdr obj)) ;the byte code
168 constvec (car (cdr (cdr obj)))) ;constant vector 169 constvec (car (cdr (cdr obj)))) ;constant vector
170 ;; If it is lazy-loaded, load it now
171 (fetch-bytecode obj)
169 (setq bytes (aref obj 1) 172 (setq bytes (aref obj 1)
170 constvec (aref obj 2))) 173 constvec (aref obj 2)))
171 (let ((lap (byte-decompile-bytecode bytes constvec)) 174 (let ((lap (byte-decompile-bytecode bytes constvec))
172 op arg opname pc-value) 175 op arg opname pc-value)
173 (let ((tagno 0) 176 (let ((tagno 0)