From xemacs-m  Tue Jul  8 11:27:46 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id LAA17070
	for <xemacs-beta@xemacs.org>; Tue, 8 Jul 1997 11:27:44 -0500 (CDT)
Received: (from hniksic@localhost)
	by jagor.srce.hr (8.8.6/8.8.6) id SAA27678;
	Tue, 8 Jul 1997 18:27:32 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: [PATCH] Losing bytecode in debug.el
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 08 Jul 1997 18:27:32 +0200
Message-ID: <kigafjxa4qz.fsf@jagor.srce.hr>
Lines: 48
X-Mailer: Gnus v5.4.59/XEmacs 20.3(beta11) - "Stockholm"

We should give this thing a fancy name -- smallpox, maybe?
`debug-on-entry' is broken without this patch.

1997-07-08  Hrvoje Niksic  <hniksic@srce.hr>

	* prim/debug.el (debug-convert-byte-code): Use compiled-function
	accessor functions.

--- lisp/prim/debug.el.orig	Tue Jul  8 17:58:54 1997
+++ lisp/prim/debug.el	Tue Jul  8 18:14:20 1997
@@ -483,19 +483,22 @@
 (defun debug-convert-byte-code (function)
   (let ((defn (symbol-function function)))
     (if (not (consp defn))
-	;; Assume a compiled code object.
-	(let* ((contents (append defn nil))
-	       (body
-		(list (list 'byte-code (nth 1 contents)
-			    (nth 2 contents) (nth 3 contents)))))
-	  (if (nthcdr 5 contents)
-	      (setq body (cons (list 'interactive (nth 5 contents)) body)))
-	  (if (nth 4 contents)
+	;; Assume a compiled-function object.
+	(let* ((body
+		(list (list 'byte-code
+			    (compiled-function-instructions defn)
+			    (compiled-function-constants defn)
+			    (compiled-function-stack-depth defn)))))
+	  (if (compiled-function-interactive defn)
+	      (setq body (cons (compiled-function-interactive defn) body)))
+	  (if (compiled-function-doc-string defn)
 	      ;; Use `documentation' here, to get the actual string,
 	      ;; in case the compiled function has a reference
 	      ;; to the .elc file.
 	      (setq body (cons (documentation function) body)))
-	  (fset function (cons 'lambda (cons (car contents) body)))))))
+	  (fset function (cons 'lambda (cons
+					(compiled-function-arglist defn)
+					body)))))))
 
 (defun debug-on-entry-1 (function defn flag)
   (if (subrp defn)

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
4.  Thou shalt not warlorde a sig if it bee the sig of Kibo, nor if
    it bee the sig of the Inner Circle.

