Disable Org-mode Babel evaluation confirmation per file

Today I started experimenting with Babel, part of org-mode that enables execution of code defined inside your org file. It’s great, although it’s taking me a little effort to get use to it.

Well, as with any mechanism that executes arbitrary code in your machine, it’s a security risk, so by default, org-mode ask you prompts you for confirmation before executing any block of code. Well, what if you are writing the org file and the code can be considered trustworthy, but you are asked every. single. time. whether it’s OK or not to execute that file? As I found in Irreal’s blog post, doing that is as easy as putting

# -*- org-confirm-babel-evaluate: nil -*-

at the beginning of your org-file. In retrospective, it’s the obvious solution. I always forget file vars.

org-mode + wordpress = org2blog awesomeness

I haven’t been blogging for a long time, and while most of the “reasons” for that have to do with my amount of free time, I also needed a small push to do it. My blog engine, as stated in another blog post, is WordPress. It’s full featured and very nice, but as a guy who lives inside Emacs as much as possible, the web interface is sub-optimal.

For those who doesn’t know it Org-mode is an Emacs mode for /keeping notes, maintaining ToDo lists, doing project planning, and authoring with a fast and effective plain-text system/. If you want to learn more about it take a look at its manual or to the Talks and screencast.

Well, I’m definitely not the only one blogging using orgmode, take a look at this post in the emacs-fu blog (which by the way is very good) which is a nice introduction to orgmode capabilities and markup.

So, let’s assume you wrote your post in orgmode, and you have your wordpress blog, and you want to publish… you have the awesome tool org2blog. Very simple to use, you just do a checkout of the git repository

git clone http://github.com/punchagan/org2blog.git

then copy the the corresponding files to a directory in your load-path. My .emacs looks like this:

(require 'org2blog)
(setq org2blog-server-url "http://www.rlazo.org/xmlrpc.php"
     org2blog-server-user "admin"
     org2blog-use-tags-as-categories t
     org2blog-confirm-post t
     org2blog-server-weblog-id "")

It’s pretty much self-explanatory.

My configuration is a single file where each post is a subtree, using the same idea that Sacha Chua explains in this post (BTW, that is also a nice blog to follow). If you read that post you will find that you need to patch the code from org2blog to add the command to create a blog post from the current subtree (which is org2blog-post-subtree ). But, since then, those changes have been integrated into org2blog repository, so no more patching required :). Happy blogging!