From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Different behaviour while debugging? Date: Wed, 20 Feb 2013 07:08:29 -0800 Message-ID: <4DC3DFD1AA9D4DF69F6EB64B989F9A11@us.oracle.com> References: <87mwuzkp8i.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1361372933 9413 80.91.229.3 (20 Feb 2013 15:08:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Feb 2013 15:08:53 +0000 (UTC) To: "'Thorsten Jolitz'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 20 16:09:14 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U8BIH-00067A-J7 for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Feb 2013 16:09:13 +0100 Original-Received: from localhost ([::1]:44123 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8BHx-0000gK-5W for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Feb 2013 10:08:53 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8BHk-0000Nn-Jj for help-gnu-emacs@gnu.org; Wed, 20 Feb 2013 10:08:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8BHi-0001i8-SI for help-gnu-emacs@gnu.org; Wed, 20 Feb 2013 10:08:40 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:19157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8BHi-0001hm-NE for help-gnu-emacs@gnu.org; Wed, 20 Feb 2013 10:08:38 -0500 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r1KF8aqM032334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Feb 2013 15:08:37 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r1KF8aof023658 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 20 Feb 2013 15:08:36 GMT Original-Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r1KF8auh000826; Wed, 20 Feb 2013 09:08:36 -0600 Original-Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 20 Feb 2013 07:08:35 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87mwuzkp8i.fsf@gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac4PeqDjx87JdNogSHKUsT0xO0oGvAAAKr3g X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89184 Archived-At: > 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'.