From: "Drew Adams" <drew.adams@oracle.com>
To: "'Thorsten Jolitz'" <tjolitz@gmail.com>, <help-gnu-emacs@gnu.org>
Subject: RE: Different behaviour while debugging?
Date: Wed, 20 Feb 2013 07:08:29 -0800 [thread overview]
Message-ID: <4DC3DFD1AA9D4DF69F6EB64B989F9A11@us.oracle.com> (raw)
In-Reply-To: <87mwuzkp8i.fsf@gmail.com>
> I have the very strange case that a program - in some special
> situation
> - does not work as expected, but when I instrument the relevant
> function(s) for edebug and single-step through them, everythings works
> as expected and the output is fine.
>
> There are no errors involved, so 'toggle-debug-on-error does not help.
> Its just that the program should put a buffer temporarily into a given
> major-mode and uncomment some comment-lines with 'uncomment-region'
> before turning-on Org-mode.
Yes, it can happen that using the debugger gives you different behavior,
especially when there are changes of selected window or current buffer or frame
focus, or there is interaction with a timer or some events. It's a case of the
observer affecting the observation, in some sense.
The debugger is pretty useful most of the time, but there are cases where you
need to find another solution. Typically you can insert calls to `message' in
the code to be debugged, perhaps with accompanying `sleep-for' or `sit-for'
calls.
Before you do that, however, try the normal Emacs debugger, `debug', instead of
`edebug'. You can use `M-x debug-on-entry' to do that. Or you can insert calls
`(debug)' in the code itself. See the manual or `C-h f debug' for more info
about using `debug'.
next prev parent reply other threads:[~2013-02-20 15:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-20 14:57 Different behaviour while debugging? Thorsten Jolitz
2013-02-20 15:08 ` Drew Adams [this message]
2013-02-20 15:45 ` Thorsten Jolitz
2013-02-20 16:25 ` Drew Adams
2013-02-20 16:50 ` Thorsten Jolitz
2013-02-20 15:56 ` Stefan Monnier
2013-02-20 16:31 ` Thorsten Jolitz
2013-02-22 14:06 ` Stefan Monnier
2013-02-22 17:44 ` Thorsten Jolitz
2013-02-22 18:56 ` Andreas Röhler
2013-02-23 9:07 ` Thorsten Jolitz
2013-02-23 11:35 ` Andreas Röhler
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=4DC3DFD1AA9D4DF69F6EB64B989F9A11@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
--cc=tjolitz@gmail.com \
/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.
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).