A Literate Programming Example with Org Mode

Arne Babenhauserheide has posted a nice example of literate programming with Org mode. It's a bare-bones example but shows what you can do including stitching code blocks together.

Using Org mode for literate programming probably isn't as powerful as something like Knuth's CWEB but it does have the advantage of working with just about any language and of running the code directly from the (untangled) source file to insert results directly into the document.

Even if, like many people, you don't care for the literate programming paradigm, the idea of combining code and narrative is still very powerful. The approach used by (for example) John Kitchen to embed the code used for calculations and figure generation is a huge aid in reusing results, calculations, and figures and is a significant step towards reproducible research.

In any event, take a look at Babenhauserheide's example. It may give you some useful ideas and it certainly serves as another demonstration of the power of Org mode and Babel.

Posted in General | Tagged , | Leave a comment

Google Reneges on Their Privacy Pledge

If you were surprised by this

you haven't been paying attention.

Google is in the business of collecting information about you and selling it to advertisers. That imperative informs just about everything they do. You can think of “Don't be evil” as a sunny Norman Rockwell painting of a world that probably never existed and certainly doesn't now.

I long ago switched to DuckDuckGo for my web searching and you'd be wise to do likewise. Likewise, I use Gmail only as a forwarder for technical mailing lists so Google probably knows I'm a geek. I try to limit their knowledge to that.

Posted in General | Tagged | Leave a comment

Reproducible Research Webinar

Back in June I wrote about A Complete Example of Reproducible Research with Org. One of the authors of that paper was Arnaud Legrand who has an excellent webinar on reproducible research. Sadly, the video of the talk is in Flash, which makes it unwatchable for many of us. Happily they also have an MPEG4 version but it took a long time to download. Nonetheless, it was worth the wait. It's a really great talk on why you should be doing reproducible research and a demonstration of some of the tools you can use to help you organize and produce it.

The first half of the talk considers the problems that ordinary research papers can have and how reproducible research can help solve them. Legrand also talks about some problems with implementing reproducible research. In the second half of the talk, Legrand demonstrates a few of the tools that a researcher can use to help with producing reproducible research.

One of these, reprozip, helps you capture the environment that you used to run your software. He also looks at Rstudio and Ipython and shows how they can help produce papers while embedding code and results directly into the final result. His favorite tool, though, is Emacs/Org Mode, which he says is more powerful and versatile. He describes how he and his students keep journals (in Org mode) that record everything they did and the results they got. These journals are invaluable when it comes time to write the paper. If you read Legrand's complete example paper, you saw an example of this is in action.

The talk is just over 2 hours 45 minutes so you're going to have to block out time (or several times) to watch. It's worth it though, so if you have any interest at all in the subject matter, I urge you to take the time. Don't worry too much about reading everything on his slides because they are also available.

Finally, I'm happy to report that this is the first in a series of Webinars on reproducible research. There a three more currently available and another is planned for some time this month. The others webinars discuss

  • Controlling your environment
  • Numerical reproducibility
  • Logging and backing up your work

If you follow the link to the other videos, you will find a list of topics they plan to cover in the future.

Posted in General | Tagged , , | 1 Comment

Org Mode for PhD Students

It's pretty much conventional wisdom that Org Mode is the killer app for Emacs. Even people who don't use Emacs seem to be aware of that and, of course, there are various efforts underway to port Org to other editors.

Matthieu Caneill considers how Org Mode can be leveraged by PhD students to organize their work and research. He discusses his file setup and how he uses each one in his workflow. It's a nice way of organizing things and exactly what you'd expect an Org mode beginner to have. Lots of people, including me, use similar organizations but it's not the only strategy available. Another possibility—and one that is arguably more Org like—is to have a single file for all your long term activities. The use of tags and advanced searching functionality make this an ideal solution.

My journal file is pretty much like that but I have a few others for things like managing my blog and recording medical/exercise data. If I were starting over, I'd consider combining everything—or almost everything—into a single journal file. In any event, if you're starting your PhD—regardless of your area—you should consider organizing things in Org. It's all plain text so you're not stuck and can move to something else if you find it suits your needs better.

Over and over again, you hear people saying how much Org mode increased their efficiency and productivity. If you're starting work on a PhD, your going to need all the help you can get so it's worth spending a little time coming up to speed with Emacs and Org mode.

Posted in General | Tagged , | Leave a comment

Public Service Announcement

Posted in General | Tagged | Leave a comment


Irreal's quest for world domination has been temporarily suspended due to the DDoS attack on Dyn. While we wait for the issue to get resolved, here's a very nice offering from mbork (Marcin Borkowski).

I use recenter-top-bottom (bound to Ctrl+l) all the time time but didn't know about reposition-window. The effect is similar but reposition-window tries to get the current function definition—for various values of “function definition”—or the associated comment onto the screen where it will be visible to the maximum extent. The behavior's a bit complicated so you should read the docstring to see exactly what happens.

The situation that reposition-window is designed to handle happens often enough that it's worth remembering the command. The fact that it's bound to almost the same sequence as recenter-top-bottom makes it easy to remember how to invoke it, at least if you use recenter-top-bottom a lot like I do.

Posted in General | Tagged | Leave a comment

Redirecting eshell Output to Another Buffer


is kind of cute but, of course, there are more direct ways of getting an external command's output into an Emacs buffer. Still, one can imagine where something like this might be useful. It shows, once again, how powerful the Emacs environment is and serves as an another example of why many of us never want to leave Emacs.

Posted in General | Tagged | Leave a comment

Setting a Prefix Argument

Here's a nice quickie from Grant Rettke. You probably won't need this often but when you do, it's just what you need.

Posted in General | Tagged | 1 Comment

Merging with smerge

I don't often have occasion to resolve git merge conflicts so I never remember the details and end up changing things by hand. This tweet

caught my attention so I followed the link and read about smerge. It's a lighter weight solution than ediff and thus easier to use. I hardly ever use ediff so I always have to figure things out when I do. That's not really what you want to be doing in the middle of resolving a merge conflict so smerge is perfect for me because there's not much to remember. All you have to do is press Return while the point is on an unresolved file and you enter smerge-mode.

I really should take the time to get proficient with ediff but until I do, smerge is an easy way to resolve conflicts without invoking the heavy machinery of ediff.

Posted in General | Tagged , | 10 Comments

Emacs 25.2 Coming Soon

One of the things John Wiegley said he'd like to do when he took over leadership of Emacs development was to have more frequent releases. It looks as if things are on track:

Thanks to John and Eli and the other developers for making it happen.

Posted in General | Tagged | Leave a comment