From: Chong Yidong <cyd@stupidchicken.com>
Cc: rms@gnu.org, emacs-devel <emacs-devel@gnu.org>
Subject: Re: [Stephen.Berman@bogus.example.com: Emacs hangs while edebugging recentf.el]
Date: Fri, 16 Dec 2005 10:35:25 -0500 [thread overview]
Message-ID: <871x0drr5u.fsf@stupidchicken.com> (raw)
In-Reply-To: <43A26B64.6030901@gmx.at> (martin rudalics's message of "Fri, 16 Dec 2005 08:23:16 +0100")
martin rudalics <rudalics@gmx.at> writes:
> > It works for me, at least using the recipe given in the original
> > email. What steps are you using?
>
> `edebug-defun' on `widget-field-find' and customizing some arbitrary
> editable field. And `edebug-print-level' equalling 50. My (Windows ME)
> swap area quickly grew from its usual 70MB to nearly 500MB before I was
> able to kill Emacs.
OK, I guess that hack was not good enough to cover all situations.
Try this one; it should be pretty much bulletproof.
*** emacs/src/print.c.~1.215.~ 2005-12-15 19:09:36.000000000 -0500
--- emacs/src/print.c 2005-12-16 10:20:17.000000000 -0500
***************
*** 1313,1326 ****
/* Give up if we go so deep that print_object will get an error. */
/* See similar code in print_object. */
! /* Because print_preprocess "follows" nested lists in a slightly
! different order from print_object, there is a risk of giving up
! too soon. In that case, a deeply nested circular list may cause
! print_object to loop. Using 3 * PRINT_CIRCLE should make this
! possibility negligible, but at some point someone will have to
! sit down and do a more careful analysis. -- cyd */
! if (print_depth >= 3 * PRINT_CIRCLE)
! return;
/* Avoid infinite recursion for circular nested structure
in the case where Vprint_circle is nil. */
--- 1313,1320 ----
/* Give up if we go so deep that print_object will get an error. */
/* See similar code in print_object. */
! if (print_depth >= PRINT_CIRCLE)
! error ("Apparently circular structure being printed");
/* Avoid infinite recursion for circular nested structure
in the case where Vprint_circle is nil. */
*** emacs/lisp/emacs-lisp/edebug.el.~3.84.~ 2005-12-13 21:38:03.000000000 -0500
--- emacs/lisp/emacs-lisp/edebug.el 2005-12-16 10:29:59.000000000 -0500
***************
*** 3711,3717 ****
(print-level (or edebug-print-level print-level))
(print-circle (or edebug-print-circle print-circle))
(print-readably nil)) ;; lemacs uses this.
! (edebug-prin1-to-string value)))
(defun edebug-compute-previous-result (edebug-previous-value)
(if edebug-unwrap-results
--- 3711,3719 ----
(print-level (or edebug-print-level print-level))
(print-circle (or edebug-print-circle print-circle))
(print-readably nil)) ;; lemacs uses this.
! (condition-case nil
! (edebug-prin1-to-string value)
! (error "# Circular or too deeply-nested structure #"))))
(defun edebug-compute-previous-result (edebug-previous-value)
(if edebug-unwrap-results
next prev parent reply other threads:[~2005-12-16 15:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-15 18:39 [Stephen.Berman@bogus.example.com: Emacs hangs while edebugging recentf.el] martin rudalics
2005-12-16 0:12 ` Chong Yidong
2005-12-16 7:23 ` martin rudalics
2005-12-16 15:35 ` Chong Yidong [this message]
2005-12-17 11:39 ` martin rudalics
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871x0drr5u.fsf@stupidchicken.com \
--to=cyd@stupidchicken.com \
--cc=emacs-devel@gnu.org \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).