Try and fix w32 build; misc cleanup.
[bpt/emacs.git] / lisp / emacs-lisp / disass.el
index dc33804..9ee02a9 100644 (file)
@@ -1,7 +1,6 @@
 ;;; disass.el --- disassembler for compiled Emacs Lisp code
 
-;; Copyright (C) 1986, 1991, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1986, 1991, 2002-2011 Free Software Foundation, Inc.
 
 ;; Author: Doug Cutting <doug@csli.stanford.edu>
 ;;     Jamie Zawinski <jwz@lucid.com>
@@ -73,19 +72,22 @@ 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))
-    (if (and (listp obj) (eq (car obj) 'autoload))
-       (progn
-         (load (nth 1 obj))
-         (setq obj (symbol-function 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 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)))
@@ -216,7 +218,9 @@ OBJ should be a call to BYTE-CODE generated by the byte compiler."
          (cond ((memq op byte-goto-ops)
                 (insert (int-to-string (nth 1 arg))))
                ((memq op '(byte-call byte-unbind
-                           byte-listN byte-concatN byte-insertN))
+                           byte-listN byte-concatN byte-insertN
+                           byte-stack-ref byte-stack-set byte-stack-set2
+                           byte-discardN byte-discardN-preserve-tos))
                 (insert (int-to-string arg)))
                ((memq op '(byte-varref byte-varset byte-varbind))
                 (prin1 (car arg) (current-buffer)))