Literate programming and my Emacs configuration file

Update 2013-08-30: Changed Emacs Starter Kit link. Thanks, Thomas!

Inspired by the Emacs Starter Kit and the literate programming features in org-babel, I reviewed and organized my Emacs configuration. I’m looking forward to adding more notes to my configuration as I explore!

Literate programming is the idea that you should write first and program second, and that you can interweave the program into your explanation. Nifty.

Here’s my Emacs configuration (you can also find it at sach.ac/dotemacs. Share yours! =)

3 Pingbacks/Trackbacks

  • http://www.questsin.com/ Nicholas Manolakos

    Interesting idea. I kind of do the opposite. Instead of writing traditional notes.

    I write then in JSON and use a NOSQL browsing engine to explore the results in different templates/perspectives like lists, tagcloulds, connections.

  • http://gwenhael.net Gwenhael

    Interesting.

    Here’s my much less neatly organized babel-init.org : http://dl.dropbox.com/u/3174596/babel-init.html

    It’s gone a bit messy with time but isn’t that what .emacs all do?…

  • http://findme.travishartwell.net/ Travis B. Hartwell

    Here’s mine:
    https://github.com/travisbhartwell/emacs-config

    I’d been considering doing something like this. I’ve been wanting to clean up some of the cruft in parts, so this might be a good opportunity to do so.

    Looks great!

    • http://sachachua.com Sacha Chua

      Oooooh. Thanks for sharing! Looking forward to borrowing interesting snippets. =D

  • http://Prabuayyagari.com Prabu Ayyagari

    @Sacha – Thanks for sharing. The comments in the .emacs file help me as I set up my org mode instance. Question: when you used Lotus Notes, what was your workflow for work-related calendar items? Did you copy from Lotus Notes (without call-in details) into org mode so it showed up in the agenda? If yes, did you then have to refer to the original to dial into conference calls?

    @Gwen, @Travis – thanks for sharing.

  • http://sachachua.com Sacha Chua

    When I was on Lotus Notes, I used an internal script that someone else in IBM put together in order to convert appointments into iCal. That made it easier. I also sometimes created manual entries for important dates. Never quite got it fully integrated, though.

  • http://www.tucker-kellogg.com/blog GTK

    Sacha,

    your config is an Org mode file with emacs lisp snipets. Do you have it called something like ‘starter-kit-sacha.org’ and then load it with (starter-kit-load “sacha”), or do you tangle out the elisp into a .el file?

  • http://sachachua.com Sacha Chua

    The Starter Kit automatically loads (username).org, so I have it saved as Sacha.org in my ~/.emacs.d. =)

  • http://www.tucker-kellogg.com/blog GTK

    Thanks! (How did I miss that?) I also can’t seem to get show-paren-mode to work. It seems to highlight both parens when on the opening paren, but not the closing paren.

  • http://greg.thewhittiers.com Greg

    (setq org-agenda-files ‘(“~/personal/organizer.org” “~/personal/business.org”))

    You keep everything in two files? (Or at least only include TODOs in two .org files.) How big and how deeply nested are these? How do you archive?

    (BTW, the yellow font in http://dl.dropbox.com/u/3968124/sacha-emacs.html is unreadable. I looked at this a couple of days ago and it was fine.)

  • http://sachachua.com Sacha Chua

    Fixed the colour scheme by changing my share function to temporarily switch to a light-background scheme. Thanks for pointing that out!

    609,304 bytes in my organizer.org file, probably because I haven’t archived old weekly reviews. Many notes become blog posts, so I use the Org archive function to stash those after publishing on my blog.

    I’ve added short descriptions of my other files in the My files section of my Org configuration. I rediscovered quite a few files I’d forgotten! =) My main Org file has the following headings: Reference, Blog ideas, Stuff to watch out for, Projects, Weekly review, Monthly review, Snippets, Routines, Tasks, 2011, and 2012.

  • http://vinylisland.org Damon Haley

    Great post. It finally gave me the inspiration to publish my literate config instance also based on Eric Schulte’s literate starter kit at:

    https://github.com/dhaley/ewax.

    I’ve already taken some items from your recently published config. As you’ll see there are quite a few sacha prefixed functions in mine.

    My literate config needs lots more annotation (as I get time) to actually explain the stuff I find most useful.

    I also need to document how I’m using Howard’s Rheingold’s PLN idea of filtering RSS feeds inside Yahoo Pipes (from his book Net Smart) with Gnus virtual groups and Gwene.org. Combined with w3m using a tor privoxy proxy, I like the http://www.freedomboxfoundation.org/ idea of not being tracked by Facebook and other marketing companies while pulling the useful parts of the web into emacs.

    I’m also fully incorporated Bernt Hansen’s GTD config, which is one of the most masterful I’ve seen.

    It would eventually be nice to have a list of all the published starter kit instances, so we could borrow new Emacs 24 config items from each other.

    Damon

  • http://ryuslash.org Tom

    Thank you for sharing this, your init/org file and the links you posted really helped me to get started with this, before this I couldn’t see the use of trying this and I really didn’t get how it worked in org. But now I’m working on making my init file literate as well, here‘s the HTML version (if you’re interested) of what I have so far.

    I got a little hooked on it and actually went a little overboard, I’m trying to get (almost) all of my dotfiles (sources) in this format using a bunch of makefiles. It’s a nice excercise in Makefile, writing and configuration file management and I’m having lots of fun with it. And since this is the post that really got me started with it: Thanks!

  • http://www.noorul.com Noorul

    Are you not using Gnus these days?

  • http://sachachua.com Sacha Chua

    Not at the moment. I should probably figure out how to get Gmail working nicely with Windows 7 and Gnus again…

  • Frieder Wittmann

    More interesting would be to have a virtual machine image or at least a self sustaining code package, without outside dependencies (like CDE [1]) so one can _practically_ reproduce the science.

    [1] http://pgbovine.net/cde.html

  • http://sachachua.com Sacha Chua

    That would be an awesome way to let people try things out. =)

  • arnebab

    Having a virtual machine image would be really cool, but impractical for me: We already struggle with disk-space for all the meteorological input data, so creating a virtual machine which needs another full copy of the input data would be a huge ordeal.

    I try to keep close to published input data, though, and to document every step I do to process it for the models I use.

    But CDE actually sounds pretty nice – though I prefer sharing sources. I want people to not just be able to redo what I did, but to be able to work on it. And for that they need the sources. But just being able to run the program is a nice first step. → went into my remember file.

    Thanks!

  • Pingback: Literate Programming Links | Bills Blog

  • http://twitter.com/jonnay Jonathan Arkell

    Using org-babel for startup is truly the path to enlightenment. Here is my crack at it:

    https://github.com/jonnay/emagicians-starter-kit

  • Pingback: Literate Programming Links – Revised | Bills Blog

  • Thomas Worthington

    The Emacs starter kit link in the post is broken; it seems to have moved here:

    http://eschulte.github.io/emacs-starter-kit/

  • Tomas Zellerin

    Sorry for reacting to this slightly aged post, but for me, there is some pain there as the descriptions(as in describe-function) of objects defined in org-babel point to tangled file, not to the original. So unless I take care, I find myself editing the generated file, not the original source. I could (in fact, in few cases I did) some modifications of load-history variable at the end of the generated file, but I wonder if it noone else sees this as a problem, or if I miss something trivial/do something wrong.

    • http://sachachua.com sachac

      Mmm… I use a quick shortcut to open my Sacha.org configuration file, so that’s why I don’t run into that – I don’t use describe-function, I open my Sacha.org file and use isearch. =) Maybe that would work for you?

      • Tomas Zellerin

        Understood, I may try that. However, that means working specially with functions I defined myself.

  • Pingback: Literate Programming and Your Emacs Configuration | Irreal