Replace "Maintainer: FSF" with the emacs-devel mailing address
[bpt/emacs.git] / lisp / emacs-lisp / disass.el
index 9ee02a9..bf013ea 100644 (file)
@@ -1,10 +1,10 @@
 ;;; disass.el --- disassembler for compiled Emacs Lisp code
 
-;; Copyright (C) 1986, 1991, 2002-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1986, 1991, 2002-2014 Free Software Foundation, Inc.
 
 ;; Author: Doug Cutting <doug@csli.stanford.edu>
 ;;     Jamie Zawinski <jwz@lucid.com>
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
 
 ;; This file is part of GNU Emacs.
@@ -35,6 +35,8 @@
 
 ;;; Code:
 
+(require 'macroexp)
+
 ;;; The variable byte-code-vector is defined by the new bytecomp.el.
 ;;; The function byte-decompile-lapcode is defined in byte-opt.el.
 ;;; Since we don't use byte-decompile-lapcode, let's try not loading byte-opt.
@@ -72,22 +74,16 @@ redefine OBJECT if it is a symbol."
   (let ((macro 'nil)
        (name 'nil)
        (doc 'nil)
-       (lexical-binding nil)
        args)
     (while (symbolp obj)
       (setq name obj
            obj (symbol-function obj)))
     (if (subrp obj)
        (error "Can't disassemble #<subr %s>" name))
-    (when (and (listp obj) (eq (car obj) 'autoload))
-      (load (nth 1 obj))
-      (setq obj (symbol-function name)))
-    (if (eq (car-safe obj) 'macro)     ;handle macros
+    (setq obj (autoload-do-load obj name))
+    (if (eq (car-safe obj) 'macro)     ;Handle macros.
        (setq macro t
              obj (cdr obj)))
-    (when (and (listp obj) (eq (car obj) 'closure))
-      (setq lexical-binding t)
-      (setq obj (cddr obj)))
     (if (and (listp obj) (eq (car obj) 'byte-code))
        (setq obj (list 'lambda nil obj)))
     (if (and (listp obj) (not (eq (car obj) 'lambda)))
@@ -157,7 +153,7 @@ redefine OBJECT if it is a symbol."
          (t
           (insert "Uncompiled body:  ")
           (let ((print-escape-newlines t))
-            (prin1 (if (cdr obj) (cons 'progn obj) (car obj))
+            (prin1 (macroexp-progn obj)
                    (current-buffer))))))
   (if interactive-p
       (message "")))
@@ -253,10 +249,10 @@ OBJ should be a call to BYTE-CODE generated by the byte compiler."
                       ((eq (car-safe (car-safe arg)) 'byte-code)
                        (insert "(<byte code>...)\n")
                        (mapc ;recurse on list of byte-code objects
-                        '(lambda (obj)
-                           (disassemble-1
-                            obj
-                            (+ indent disassemble-recursive-indent)))
+                        (lambda (obj)
+                           (disassemble-1
+                            obj
+                            (+ indent disassemble-recursive-indent)))
                         arg))
                       (t
                        ;; really just a constant