From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] feature request: debug messages Date: Wed, 03 Jul 2013 16:55:42 -0600 Message-ID: <878v1njlsh.fsf@gmail.com> References: <87y59n2z6b.fsf@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuVzI-000322-Lf for emacs-orgmode@gnu.org; Wed, 03 Jul 2013 18:57:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuVzG-0001sP-9W for emacs-orgmode@gnu.org; Wed, 03 Jul 2013 18:57:24 -0400 Received: from mail-pd0-x22b.google.com ([2607:f8b0:400e:c02::22b]:59618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuVzG-0001sD-3n for emacs-orgmode@gnu.org; Wed, 03 Jul 2013 18:57:22 -0400 Received: by mail-pd0-f171.google.com with SMTP id y14so513496pdi.2 for ; Wed, 03 Jul 2013 15:57:21 -0700 (PDT) In-Reply-To: <87y59n2z6b.fsf@med.uni-goettingen.de> (Andreas Leha's message of "Wed, 03 Jul 2013 21:58:36 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andreas Leha Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi Andreas, This should be easy to turn on or off using the newly introduced :prologue and :epilogue header arguments. See the manual and the following example. --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=r-debug.org #+Title: debug messages #+Property: session *R* #+Property: prologue (format "print(\"entering %s\")" (get-current-name)) An elisp block to simplify the =:prologue= definition. #+begin_src emacs-lisp (defun get-current-name () (save-excursion (goto-char org-babel-current-src-block-location) (while (and (forward-line -1) (looking-at org-babel-multi-line-header-regexp))) (when (looking-at org-babel-src-name-w-name-regexp) (org-no-properties (match-string 3))))) #+end_src Two blocks with simple assignments. #+name: block-1 #+begin_src R x <- 2 + 2 #+end_src #+name: block-2 #+begin_src R y <- x + x #+end_src Execute the whole buffer =C-c C-v b= to see the prologue in action. --=-=-= Content-Type: text/plain Andreas Leha writes: > Hi all, > > I would love to see messages like 'entering block foo...' and > '...leaving block foo' printed to my R console. This would be very > handy when I evaluate a subtree (C-c C-v s) with a lot of #+call lines > and some lengthy ones. > > I know that > (1) I could implement that myself at in the source blocks. But I would > love if orgmode did that for me > (2) Such messages are already printed to the emacs *Messages* buffer. > But that buffer might not be visible and I can not switch to it, > without interrupting the evaluation. Anyway it would be much nicer > to see that output together with the other output, that my code > generates. > > > In essence it would be very helpful, if there was a variable > org-babel-print-debug-messages (or org-babel-debug-level...) which if > non-nil would cause that messages to be printed. Or is there somewhere > already? > > Regards, > Andreas > > > > -- Eric Schulte http://cs.unm.edu/~eschulte --=-=-=--