the big question:
what in eieio.el is having the side-effect of 'read' being aliased to
'edebug-read', but only when eieio.el is byte-compiled?
i've been grepping around for it, but can't seem to find it; there's no
'edebug-read' in eieio, though there are some places in eieio.el, where edebug
forms are used.
edebug-read is giving my xemacs some indigestion problems.
anyway, here's the bug description:
there's something in a file that is loaded as a result of:
(byte-compile-and-load eieio-main-lib)
...which is redefining 'read', and making it an alias to 'edebug-read';
later,
when i run a certain function, then 'edebug-read-sexp' is causing an
error. Namely, i'm getting a strange 'exceeds max-lisp-eval-depth' error --
edebug-read-sexp starts looping.
The bug doesn't happen after a clean
(load-file eieio-main-lib)
...when 'read' is just its straight built-in 'read', and not an alias to
'ededbug-read'.
Fixing it?:
what in eieio.el is having the side-effect of 'read' being aliased to
'edebug-read', but only when folding.el is byte-compiled? i've been grepping
around for it, but can't seem to find it.
--
environment:
Emacs version: 21.4.5 , with gtk widgets, on debian linux 3.0 (woody)
As for what this xemacs 21.4.5 was compiled with,
(maphash #'(lambda (key value)
(insert (format "%s : %s" key value))
(newline))
(config-value-hash-table))
...just makes a long list of things. my concern is with finding what's
mangling the definition of 'read', and stopping it from doing that.
{{{ steps to reproduce
(require 'eieio)
;; define the function where the error seems to occur
(defun foo-serialize (project)
"return a serialized form of PROJECT, suitable for saving and restoring the
project and its slots. "
(with-temp-buffer
(let ((outv) (standard-output (current-buffer)))
;; backquote it, to keep read from evaluating it.
(insert "`")
;; the default object-write prints the data to 'standard-output'
(object-write project))
(goto-char (point-min))
; DEBUG:
(switch-to-buffer (current-buffer))
(read-string "continue...")
(condition-case err
;; this is where the read starts:
(while (setq outv (cons 'make-instance (cadr (read (current-buffer))))))
(end-of-file outv))))
;; byte-compile and load the local eieio library
(byte-compile-and-load-file
(car (member* "eieio.el" (library-all-completions "eieio" load-path
t)
:test #'string-match
:key #'file-name-nondirectory )))
;; or use the straight 0.16
;(byte-compile-and-load-file"~/project/xemacs/package/eieio/eieio-0.16/eieio.el")
;;or the un-modified 0.17beta3
;(byte-compile-and-load-file
"~/project/xemacs/package/eieio/eieio-0.17beta3/eieio.el")
; then
(defclass foo () nil)
(setq x (make-instance 'foo))
(foo-serialize x)
;; RESULT:
;; when doing that foo-serialize, i get a massive backtrace, about
;; '... exceeds 'max-lisp-eval-depth' , on 'edebug-read-sexp'.
;; Now, i _don't_ get that error, when i do one of the following:
; (require 'eieio)
;; or
; (load-file "~/project/xemacs/package/eieio/eieio-0.16/eieio.el")
;; or
; (load-file "~/project/xemacs/package/eieio/eieio-0.17beta3/eieio.el")
;...instead of any of the (byte-compile-and-load-file ...) forms, as above.
; so, 'read' is apparently only being aliased to 'ededbug-read-sexp',
during
; (byte-compile "eieio.el")
}}}
{{{ backtrace
Signaling: (error "Lisp nesting exceeds `max-lisp-eval-depth'")
edebug-next-token-class()
<snipped: a bunch of calls to edebug-read-sexp>
edebug-read-sexp()
edebug-read-sexp()
edebug-read-sexp()
edebug-read-sexp()
edebug-read-sexp()
edebug-read-sexp()
edebug-read-sexp()
edebug-read-sexp()
edebug-read-sexp()
edebug-read-sexp()
edebug-read-sexp()
edebug-read-sexp()
edebug-read-sexp()
edebug-read-sexp()
edebug-read-sexp()
edebug-read-and-maybe-wrap-form1()
byte-code("..." [result edebug-read-and-maybe-wrap-form1 nil] 1)
edebug-read-and-maybe-wrap-form()
read(#<buffer " *temp*">)
(cadr (read (current-buffer)))
(cons (quote make-instance) (cadr (read ...)))
(setq outv (cons (quote make-instance) (cadr ...)))
(while (setq outv (cons ... ...)))
(condition-case err (while (setq outv ...)) (end-of-file outv))
(save-current-buffer (set-buffer temp-buffer) (let (... ...) (insert "`")
(object-write project)) (goto-char (point-min)) (switch-to-buffer (current-buffer))
(read-string "continue...") (condition-case err (while ...) (end-of-file
outv)))
(with-current-buffer temp-buffer (let (... ...) (insert "`") (object-write
project)) (goto-char (point-min)) (switch-to-buffer (current-buffer)) (read-string
"continue...") (condition-case err (while ...) (end-of-file outv)))
(unwind-protect (with-current-buffer temp-buffer (let ... ... ...) (goto-char ...)
(switch-to-buffer ...) (read-string "continue...") (condition-case err ... ...))
(and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
(let ((temp-buffer ...)) (unwind-protect (with-current-buffer temp-buffer ... ... ...
... ...) (and ... ...)))
(with-temp-buffer (let (... ...) (insert "`") (object-write project))
(goto-char (point-min)) (switch-to-buffer (current-buffer)) (read-string
"continue...") (condition-case err (while ...) (end-of-file outv)))
foo-serialize([object foo foo])
eval((foo-serialize x))
eval-interactive((foo-serialize x))
eval-last-sexp(nil)
call-interactively(eval-last-sexp)
}}}
Show replies by date