emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Andreas Leha <andreas.leha@med.uni-goettingen.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] feature request: debug messages
Date: Wed, 03 Jul 2013 16:55:42 -0600	[thread overview]
Message-ID: <878v1njlsh.fsf@gmail.com> (raw)
In-Reply-To: <87y59n2z6b.fsf@med.uni-goettingen.de> (Andreas Leha's message of "Wed, 03 Jul 2013 21:58:36 +0200")

[-- Attachment #1: Type: text/plain, Size: 164 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: r-debug.org --]
[-- Type: text/x-org, Size: 739 bytes --]

#+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.

[-- Attachment #3: Type: text/plain, Size: 1037 bytes --]


Andreas Leha <andreas.leha@med.uni-goettingen.de> 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

  reply	other threads:[~2013-07-03 22:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-03 19:58 [babel] feature request: debug messages Andreas Leha
2013-07-03 22:55 ` Eric Schulte [this message]
2013-07-04  6:42   ` Andreas Leha
2013-07-04 14:48     ` Eric Schulte
2013-07-06 16:00       ` Andreas Leha
2013-07-07 17:08         ` Eric Schulte
2013-07-07 19:24           ` Andreas Leha
2013-07-08  2:03             ` Eric Schulte
2013-07-20 15:11       ` Andreas Leha
2013-07-20 15:24         ` Andreas Leha
2013-07-20 15:33           ` Andreas Leha
2013-07-23 22:12             ` Eric Schulte
2013-07-25  8:14               ` Andreas Leha
2013-07-25 13:37                 ` Eric Schulte
2013-07-25 15:18                   ` Andreas Leha
2013-07-25 16:07                     ` Eric Schulte

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.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878v1njlsh.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=andreas.leha@med.uni-goettingen.de \
    --cc=emacs-orgmode@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/org-mode.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).