From xemacs-m  Sun Feb 23 16:01:01 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id QAA10870
	for <xemacs-beta@xemacs.org>; Sun, 23 Feb 1997 16:00:56 -0600 (CST)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.5/8.8.5) id OAA22177;
	Sun, 23 Feb 1997 14:12:48 -0800
Mail-Copies-To: never
To: xemacs-beta@xemacs.org
Subject: Re: edebug with backquotes
References: <kigybcf7avz.fsf@jagor.srce.hr> 	<QQceek10044.199702232043@crystal.WonderWorks.COM> 	<kigohdb6w9v.fsf@jagor.srce.hr> <QQceep11352.199702232152@crystal.WonderWorks.COM>
X-Url: http://www.miranova.com/%7Esteve/
X-Face: #!T9!#9s-3o8)*uHlX{Ug[xW7E7Wr!*L46-OxqMu\xz23v|R9q}lH?cRS{rCNe^'[`^sr5"
 f8*@r4ipO6Jl!:Ccq<xoV[Qz2u8<8-+Vwf2gzJ44lf_/y9OaQ`@#Q65{U4/TC)i2`~/M&QI$X>p:9I
 OSS'2{-)-4wBnVeg0S\O4Al@)uC[pD|+
X-Attribution: sb
From: Steven L Baur <steve@miranova.com>
In-Reply-To: Kyle Jones's message of Sun, 23 Feb 1997 16:52:50 -0500 (EST)
Mime-Version: 1.0 (generated by tm-edit 7.105)
Content-Type: text/plain; charset=US-ASCII
Date: 23 Feb 1997 14:12:47 -0800
Message-ID: <m2g1ynnpcw.fsf@altair.xemacs.org>
Lines: 275
X-Mailer: Gnus v5.4.15/XEmacs 20.1

Kyle Jones writes:

> Hrvoje Niksic writes:
>> Kyle Jones <kyle_jones@wonderworks.com> writes:
>> 
>> > Rather than trying to debug it, better to just sync with the
>> > edebug.el in FSF Emacs, I think.  Hrvoje, you might try loading
>> > the FSF Emacs version and see how badly it is broken under
>> > XEmacs.
>> 
>> Quite badly, I'm afraid.  It kept telling me that `Symbol's value as
>> variable is void: unread-command-char', but not even setting
>> `debug-on-error' to t would show where the error is.

> That's not so bad.  Probably just need to use
> unread-command-event or unread-command-events instead.

Nope.  There's a lot more to it than that.  It looks like it might be
an incompatibility in our internal representation of backquote.

> Steve, I assume you fixed this already... ?

I'm looking at it.  I've already been over edebug once as it wasn't
bytecompilable in 19.14.

Here is a more detailed backtrace taken by doing an eval-buffer on
edebug.el prior to attempting to instrument Hrvoje's test function.


Signaling: (wrong-type-argument consp 34)
  cdr(34)
  (setcdr cursor (cdr (cdr cursor)))
)
  edebug-move-cursor((((... ...)) . 34))
  (edebug-list-form-args head (edebug-move-cursor cursor))
)
  (cons head (edebug-list-form-args head (edebug-move-cursor cursor)))
)
  (cond ((null head) (edebug-syntax-error "nil head")) ((eq head ...) (setq edebug-def-interactive ...) (edebug-move-cursor cursor) (edebug-interactive-p-name)) (t (cons head ...)))
)
  (cond ((null head) nil) ((symbolp head) (cond ... ... ...)) ((consp head) (if ... ... ...)) (t (edebug-syntax-error "Head of list form must be a symbol or lambda expression.")))
)
  (let ((head ...) (edebug-gate t) (edebug-&optional nil) (edebug-&rest nil)) (edebug-set-cursor cursor (edebug-cursor-expressions cursor) (cdr ...)) (cond (... nil) (... ...) (... ...) (t ...)))
)
  edebug-list-form((((... ...)) . 34))
  (edebug-make-before-and-after-form (edebug-inc-offset (car offset)) (edebug-list-form new-cursor) (edebug-inc-offset (edebug-cursor-offsets new-cursor)))
)
  (if (and (consp spec) (eq ... ...)) (edebug-defining-form new-cursor (car offset) (edebug-after-offset cursor) (cons ... ...)) (edebug-make-before-and-after-form (edebug-inc-offset ...) (edebug-list-form new-cursor) (edebug-inc-offset ...)))
)
  (let* ((head ...) (spec ...) (new-cursor ...)) (if (and ... ...) (edebug-defining-form new-cursor ... ... ...) (edebug-make-before-and-after-form ... ... ...)))
)
  (if (eq (quote quote) (car form)) form (let* (... ... ...) (if ... ... ...)))
)
  (cond ((consp form) (if ... form ...)) ((symbolp form) (cond ... ... ...)) (t form))
)
  (prog1 (cond (... ...) (... ...) (t form)) (edebug-move-cursor cursor))
)
  (let* ((form ...) (offset ...)) (prog1 (cond ... ... ...) (edebug-move-cursor cursor)))
)
  edebug-form((((backquote ...)) (25 . 34) . 35))
  (list (edebug-form cursor))
)
  edebug-match-form((((backquote ...)) (25 . 34) . 35))
  funcall(edebug-match-form (((backquote ...)) (25 . 34) . 35))
  (if (consp spec) (edebug-match cursor spec) (funcall spec cursor))
)
  (cond (spec (if ... ... ...)) ((null symbol) (edebug-match-nil cursor)) ((fboundp symbol) (let ... ...)) (t (error "%s is not a form-spec or function" symbol)))
)
  (let* ((spec ...)) (cond (spec ...) (... ...) (... ...) (t ...)))
)
  edebug-match-symbol((((backquote ...)) (25 . 34) . 35) form)
  (cond ((symbolp spec) (edebug-match-symbol cursor spec)) ((vectorp spec) (edebug-match cursor ...)) ((stringp spec) (edebug-match-string cursor spec)) ((listp spec) (edebug-match-list cursor spec)))
)
  edebug-match-one-spec((((backquote ...)) (25 . 34) . 35) form)
  (cond ((eq ?\& first-char) (funcall ... cursor ...)) ((eq ?\: first-char) (setq rest ...) (funcall ... cursor ...)) (t (setq rest ...) (edebug-match-one-spec cursor spec)))
)
  (nconc (cond (... ...) (... ... ...) (t ... ...)) (funcall remainder-handler cursor rest remainder-handler))
)
  (let* ((spec ...) (rest) (first-char ...)) (nconc (cond ... ... ...) (funcall remainder-handler cursor rest remainder-handler)))
)
  (cond ((null specs) nil) ((atom specs) (let ... ...)) ((not ...) (if ... ...) (let ... ... ...)) (t (let* ... ...)))
)
  (let ((edebug-matching-depth ...)) (cond (... nil) (... ...) (... ... ...) (t ...)))
)
  edebug-match-specs((((backquote ...)) (25 . 34) . 35) (form) edebug-&rest-wrapper)
  (setq result (edebug-match-specs cursor specs remainder-handler))
)
  (catch (quote no-match) (setq result (edebug-match-specs cursor specs remainder-handler)) nil)
)
  (null (catch (quote no-match) (setq result ...) nil))
)
  (if (null (catch ... ... nil)) result (edebug-set-cursor cursor this-form this-offset) nil)
)
  (let (result (edebug-&optional specs) (edebug-gate nil) (this-form ...) (this-offset ...)) (if (null ...) result (edebug-set-cursor cursor this-form this-offset) nil))
)
  edebug-&optional-wrapper((((backquote ...)) (25 . 34) . 35) (form) edebug-&rest-wrapper)
  edebug-&rest-wrapper((((backquote ...)) (25 . 34) . 35) (form) edebug-&rest-wrapper)
  (let ((edebug-&rest specs) edebug-best-error edebug-error-point) (edebug-&rest-wrapper cursor specs (quote edebug-&rest-wrapper)))
)
  edebug-match-&rest((((backquote ...)) (25 . 34) . 35) (form))
  funcall(edebug-match-&rest (((backquote ...)) (25 . 34) . 35) (form))
  (cond ((eq ?\& first-char) (funcall ... cursor ...)) ((eq ?\: first-char) (setq rest ...) (funcall ... cursor ...)) (t (setq rest ...) (edebug-match-one-spec cursor spec)))
)
  (nconc (cond (... ...) (... ... ...) (t ... ...)) (funcall remainder-handler cursor rest remainder-handler))
)
  (let* ((spec ...) (rest) (first-char ...)) (nconc (cond ... ... ...) (funcall remainder-handler cursor rest remainder-handler)))
)
  (cond ((null specs) nil) ((atom specs) (let ... ...)) ((not ...) (if ... ...) (let ... ... ...)) (t (let* ... ...)))
)
  (let ((edebug-matching-depth ...)) (cond (... nil) (... ...) (... ... ...) (t ...)))
)
  edebug-match-specs((((backquote ...)) (25 . 34) . 35) (&rest form) edebug-match-specs)
  (let (edebug-&optional edebug-&rest edebug-best-error edebug-error-point (edebug-gate edebug-gate)) (edebug-match-specs cursor specs (quote edebug-match-specs)))
)
  edebug-match((((backquote ...)) (25 . 34) . 35) (&rest form))
  edebug-forms((((backquote ...)) (25 . 34) . 35))
  (edebug-wrap-def-body (edebug-forms cursor))
)
  (list (edebug-wrap-def-body (edebug-forms cursor)))
)
  (let ((edebug-inside-func t)) (list (edebug-wrap-def-body ...)))
)
  edebug-match-def-body((((backquote ...)) (25 . 34) . 35))
  funcall(edebug-match-def-body (((backquote ...)) (25 . 34) . 35))
  (if (consp spec) (edebug-match cursor spec) (funcall spec cursor))
)
  (cond (spec (if ... ... ...)) ((null symbol) (edebug-match-nil cursor)) ((fboundp symbol) (let ... ...)) (t (error "%s is not a form-spec or function" symbol)))
)
  (let* ((spec ...)) (cond (spec ...) (... ...) (... ...) (t ...)))
)
  edebug-match-symbol((((backquote ...)) (25 . 34) . 35) def-body)
  (cond ((symbolp spec) (edebug-match-symbol cursor spec)) ((vectorp spec) (edebug-match cursor ...)) ((stringp spec) (edebug-match-string cursor spec)) ((listp spec) (edebug-match-list cursor spec)))
)
  edebug-match-one-spec((((backquote ...)) (25 . 34) . 35) def-body)
  (cond ((eq ?\& first-char) (funcall ... cursor ...)) ((eq ?\: first-char) (setq rest ...) (funcall ... cursor ...)) (t (setq rest ...) (edebug-match-one-spec cursor spec)))
)
  (nconc (cond (... ...) (... ... ...) (t ... ...)) (funcall remainder-handler cursor rest remainder-handler))
)
  (let* ((spec ...) (rest) (first-char ...)) (nconc (cond ... ... ...) (funcall remainder-handler cursor rest remainder-handler)))
)
  (cond ((null specs) nil) ((atom specs) (let ... ...)) ((not ...) (if ... ...) (let ... ... ...)) (t (let* ... ...)))
)
  (let ((edebug-matching-depth ...)) (cond (... nil) (... ...) (... ... ...) (t ...)))
)
  edebug-match-specs((((backquote ...)) (25 . 34) . 35) (def-body) edebug-match-specs)
  funcall(edebug-match-specs (((backquote ...)) (25 . 34) . 35) (def-body) edebug-match-specs)
  (nconc (cond (... ...) (... ... ...) (t ... ...)) (funcall remainder-handler cursor rest remainder-handler))
)
  (let* ((spec ...) (rest) (first-char ...)) (nconc (cond ... ... ...) (funcall remainder-handler cursor rest remainder-handler)))
)
  (cond ((null specs) nil) ((atom specs) (let ... ...)) ((not ...) (if ... ...) (let ... ... ...)) (t (let* ... ...)))
)
  (let ((edebug-matching-depth ...)) (cond (... nil) (... ...) (... ... ...) (t ...)))
)
  edebug-match-specs((((backquote ...)) (25 . 34) . 35) ([&optional ("interactive" interactive)] def-body) edebug-match-specs)
  funcall(edebug-match-specs (((backquote ...)) (25 . 34) . 35) ([&optional ("interactive" interactive)] def-body) edebug-match-specs)
  (nconc (cond (... ...) (... ... ...) (t ... ...)) (funcall remainder-handler cursor rest remainder-handler))
)
  (let* ((spec ...) (rest) (first-char ...)) (nconc (cond ... ... ...) (funcall remainder-handler cursor rest remainder-handler)))
)
  (cond ((null specs) nil) ((atom specs) (let ... ...)) ((not ...) (if ... ...) (let ... ... ...)) (t (let* ... ...)))
)
  (let ((edebug-matching-depth ...)) (cond (... nil) (... ...) (... ... ...) (t ...)))
)
  edebug-match-specs((((backquote ...)) (25 . 34) . 35) ([&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
  funcall(edebug-match-specs (((backquote ...)) (25 . 34) . 35) ([&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
  (nconc (cond (... ...) (... ... ...) (t ... ...)) (funcall remainder-handler cursor rest remainder-handler))
)
  (let* ((spec ...) (rest) (first-char ...)) (nconc (cond ... ... ...) (funcall remainder-handler cursor rest remainder-handler)))
)
  (cond ((null specs) nil) ((atom specs) (let ... ...)) ((not ...) (if ... ...) (let ... ... ...)) (t (let* ... ...)))
)
  (let ((edebug-matching-depth ...)) (cond (... nil) (... ...) (... ... ...) (t ...)))
)
  edebug-match-specs((((backquote ...)) (25 . 34) . 35) (lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
  funcall(edebug-match-specs (((backquote ...)) (25 . 34) . 35) (lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
  (nconc (cond (... ...) (... ... ...) (t ... ...)) (funcall remainder-handler cursor rest remainder-handler))
)
  (let* ((spec ...) (rest) (first-char ...)) (nconc (cond ... ... ...) (funcall remainder-handler cursor rest remainder-handler)))
)
  (cond ((null specs) nil) ((atom specs) (let ... ...)) ((not ...) (if ... ...) (let ... ... ...)) (t (let* ... ...)))
)
  (let ((edebug-matching-depth ...)) (cond (... nil) (... ...) (... ... ...) (t ...)))
)
  edebug-match-specs((((backquote ...)) (25 . 34) . 35) (name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
  funcall(edebug-match-specs (((backquote ...)) (25 . 34) . 35) (name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
  (nconc (cond (... ...) (... ... ...) (t ... ...)) (funcall remainder-handler cursor rest remainder-handler))
)
  (let* ((spec ...) (rest) (first-char ...)) (nconc (cond ... ... ...) (funcall remainder-handler cursor rest remainder-handler)))
)
  (cond ((null specs) nil) ((atom specs) (let ... ...)) ((not ...) (if ... ...) (let ... ... ...)) (t (let* ... ...)))
)
  (let ((edebug-matching-depth ...)) (cond (... nil) (... ...) (... ... ...) (t ...)))
)
  edebug-match-specs((((backquote ...)) (25 . 34) . 35) ("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
  (prog1 (edebug-match-specs cursor specs (quote edebug-match-specs)) (if (not ...) (if edebug-best-error ... ...)))
)
  (let (edebug-&optional) (prog1 (edebug-match-specs cursor specs ...) (if ... ...)))
)
  edebug-match-sublist((((backquote ...)) (25 . 34) . 35) ("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body))
  (list (edebug-match-sublist (edebug-new-cursor form ...) specs))
)
  (prog1 (list (edebug-match-sublist ... specs)) (edebug-move-cursor cursor))
)
  (cond ((eq ... spec) (let ... ...)) ((listp form) (prog1 ... ...)) ((and ... ...) (let ... ... ...)) (t (edebug-no-match cursor "Expected" specs)))
)
  (let ((spec ...) (form ...)) (cond (... ...) (... ...) (... ...) (t ...)))
)
  (if edebug-dotted-spec (prog1 (let ... ...) (setq edebug-dotted-spec nil)) (let (... ...) (cond ... ... ... ...)))
)
  edebug-match-list((((defun myconcat ... ...)) (1 (2 . 7) (8 . 16) (17 ... ... . 22) (25 . 34) . 35)) ("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body))
  (cond ((symbolp spec) (edebug-match-symbol cursor spec)) ((vectorp spec) (edebug-match cursor ...)) ((stringp spec) (edebug-match-string cursor spec)) ((listp spec) (edebug-match-list cursor spec)))
)
  edebug-match-one-spec((((defun myconcat ... ...)) (1 (2 . 7) (8 . 16) (17 ... ... . 22) (25 . 34) . 35)) ("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body))
  (cond ((eq ?\& first-char) (funcall ... cursor ...)) ((eq ?\: first-char) (setq rest ...) (funcall ... cursor ...)) (t (setq rest ...) (edebug-match-one-spec cursor spec)))
)
  (nconc (cond (... ...) (... ... ...) (t ... ...)) (funcall remainder-handler cursor rest remainder-handler))
)
  (let* ((spec ...) (rest) (first-char ...)) (nconc (cond ... ... ...) (funcall remainder-handler cursor rest remainder-handler)))
)
  (cond ((null specs) nil) ((atom specs) (let ... ...)) ((not ...) (if ... ...) (let ... ... ...)) (t (let* ... ...)))
)
  (let ((edebug-matching-depth ...)) (cond (... nil) (... ...) (... ... ...) (t ...)))
)
  edebug-match-specs((((defun myconcat ... ...)) (1 (2 . 7) (8 . 16) (17 ... ... . 22) (25 . 34) . 35)) (("defun" name lambda-list [&optional stringp] [&optional ...] def-body)) edebug-match-specs)
  (let (edebug-&optional edebug-&rest edebug-best-error edebug-error-point (edebug-gate edebug-gate)) (edebug-match-specs cursor specs (quote edebug-match-specs)))
)
  edebug-match((((defun myconcat ... ...)) (1 (2 . 7) (8 . 16) (17 ... ... . 22) (25 . 34) . 35)) (("defun" name lambda-list [&optional stringp] [&optional ...] def-body)))
  (if speclist (edebug-match cursor speclist) (edebug-make-enter-wrapper (list ...)))
)
  (setq result (if speclist (edebug-match cursor speclist) (edebug-make-enter-wrapper ...)))
)
  (let (edebug-offset-list (edebug-offset-index 0) result (edebug-old-def-name ...) edebug-def-name edebug-def-args edebug-def-interactive edebug-inside-func) (setq result (if speclist ... ...)) (setq edebug-def-name (or edebug-def-name edebug-old-def-name ...)) (quote (if ... ...)) (if (not form-data-entry) (setq form-data-entry ...) (edebug-set-form-data-entry form-data-entry edebug-def-name form-begin form-end)) (edebug-make-top-form-data-entry form-data-entry) (message "Edebug: %s" edebug-def-name) (setq edebug-offset-list (vconcat ...)) (edebug-clear-frequency-count edebug-def-name) (edebug-clear-coverage edebug-def-name) (if (not edebug-top-window-data) (let ... ...)) (put edebug-def-name (quote edebug) (list edebug-form-begin-marker nil edebug-offset-list edebug-top-window-data)) result)
)
  (let* ((form-data-entry ...) (edebug-form-begin-marker ...)) (let (edebug-offset-list ... result ... edebug-def-name edebug-def-args edebug-def-interactive edebug-inside-func) (setq result ...) (setq edebug-def-name ...) (quote ...) (if ... ... ...) (edebug-make-top-form-data-entry form-data-entry) (message "Edebug: %s" edebug-def-name) (setq edebug-offset-list ...) (edebug-clear-frequency-count edebug-def-name) (edebug-clear-coverage edebug-def-name) (if ... ...) (put edebug-def-name ... ...) result))
)
  edebug-make-form-wrapper((((defun myconcat ... ...)) (1 (2 . 7) (8 . 16) (17 ... ... . 22) (25 . 34) . 35)) 1 34 (("defun" name lambda-list [&optional stringp] [&optional ...] def-body)))
  (car (edebug-make-form-wrapper cursor (edebug-before-offset cursor) (1- ...) (list ...)))
)
  (let ((cursor ...)) (car (edebug-make-form-wrapper cursor ... ... ...)))
)
  (if (or edebug-all-defs edebug-all-forms) (let (...) (car ...)) (put def-name (quote edebug) (point-marker)) (quote (mapcar ... ...)) (edebug-read-sexp))
)
  (cond (defining-form-p (if ... ... ... ... ...)) (edebug-all-forms (let ... ...)) (t (edebug-read-sexp)))
)
  (let (spec def-kind defining-form-p def-name edebug-offsets edebug-offsets-stack edebug-current-offset) (save-excursion (if ... ...)) (cond (defining-form-p ...) (edebug-all-forms ...) (t ...)))
)
  edebug-read-and-maybe-wrap-form1()
  (setq result (edebug-read-and-maybe-wrap-form1))
)
  (catch (quote no-match) (setq result (edebug-read-and-maybe-wrap-form1)) nil)
)
  (setq no-match (catch (quote no-match) (setq result ...) nil))
)
  (let (result edebug-top-window-data edebug-def-name edebug-&optional edebug-&rest edebug-gate edebug-best-error edebug-error-point no-match (max-lisp-eval-depth ...) (max-specpdl-size ...)) (setq no-match (catch ... ... nil)) (if no-match (apply ... no-match)) result)
)
  edebug-read-and-maybe-wrap-form()
  (prog1 (edebug-read-and-maybe-wrap-form) (goto-char starting-point))
)
  (let ((starting-point ...)) (end-of-defun) (beginning-of-defun) (prog1 (edebug-read-and-maybe-wrap-form) (goto-char starting-point)))
)
  edebug-read-top-level-form()
  (let ((edebug-all-forms t) (edebug-all-defs t)) (edebug-read-top-level-form))
)
  (eval (let (... ...) (edebug-read-top-level-form)))
)
  edebug-defun()
  eval((edebug-defun))
  edit-and-eval-command("Redo: " (switch-to-buffer "*scratch*") (command-history . 1))
  repeat-complex-command(1)
  call-interactively(repeat-complex-command)

-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.

