Clean up various org-babel-*-maybe commands
commitbf29482973408b4a9c94e13e4c320e4c55b29490
authorAaron Ecay <aaronecay@gmail.com>
Thu, 18 Apr 2013 08:06:55 +0000 (18 04:06 -0400)
committerBastien Guerry <bzg@altern.org>
Thu, 18 Apr 2013 10:26:23 +0000 (18 12:26 +0200)
treef0f82e504986f0b192370f2b27642b9ede487529
parent79ecb6570b7dabe2321f4bc36450473e89f8d732
Clean up various org-babel-*-maybe commands

* lisp/ob-core.el (org-babel-when-in-src-block): New macro.
  (org-babel-execute-src-block-maybe)
  (org-babel-expand-src-block-maybe)
  (org-babel-load-in-session-maybe, org-babel-pop-to-session-maybe):
  Use it.

org-babel-get-src-block-info is a potentially expensive operation, which
is why its ‘light’ argument exists.  But in any case, it is overkill to
query the whole info, if all that is needed is whether point is in a
block or not.  Factor the simplified common code out into a macro.
lisp/ob-core.el