From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Re: [babel] Executing sh-code Date: Mon, 30 Nov 2009 11:02:09 -0500 Message-ID: <8164.1259596929@alphaville.usa.hp.com> References: <87k4xey99s.fsf@mundaneum.com> <200911271900.08393.torsten.wagner@googlemail.com> <87ws1cgsd6.fsf@mundaneum.com> <877htb4uow.fsf@stats.ox.ac.uk> <87638tnivd.fsf@mundaneum.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NF8is-0005Y4-9O for emacs-orgmode@gnu.org; Mon, 30 Nov 2009 11:03:34 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NF8in-0005Wu-93 for emacs-orgmode@gnu.org; Mon, 30 Nov 2009 11:03:33 -0500 Received: from [199.232.76.173] (port=51434 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NF8im-0005Wo-SY for emacs-orgmode@gnu.org; Mon, 30 Nov 2009 11:03:28 -0500 Received: from g1t0029.austin.hp.com ([15.216.28.36]:22114) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NF8im-0001yU-GI for emacs-orgmode@gnu.org; Mon, 30 Nov 2009 11:03:28 -0500 In-Reply-To: Message from "Eric Schulte" of "Mon, 30 Nov 2009 08:44:55 MST." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: =?utf-8?Q?S=C3=A9bastien?= Vauban , emacs-orgmode@gnu.org Eric Schulte wrote: > Hi S=C3=A9bastien, > > S=C3=A9bastien Vauban writes: > > [...] > > > > Just for my information (maybe being able to be more accurate next time, = > or > > even finding a solution myself), how do you debug such a problem? > > > > With which debugger, with tracing/stepping? With stack trace? > > > > I'm almost embarrassed to admit that I do most of my elisp debugging > with the `message' function. I embed `message' debug statements to > print the values of key variables at key points, and I run through > problems looking at the output. > > I'd be interested to hear if anyone can recommend a better elisp > debugging solution. > There are two methods that I use that I think are much more effective than sprinkling message calls all over the place: o edebug-defun: (in emacs-lisp mode, C-u C-M-x) will mark the function so that when it is called, the interpreter stops and you can then single-step through it with . At each point, you can press "e" and evaluate variables (actually arbitrary expressions). o Insert a strategically placed (debug) call and then call the function. If/when the debug call is executed, you are dropped into the debugger and you can then evaluate arbitrary expressions. HTH, Nick