6079 comments
2357 subscribers
6213 on Twitter
Subscribe! Feed reader E-mail

Literate programming and my Emacs configuration file

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. Share yours! =)

Short URL: http://sachachua.com/blog/p/23472
  • 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

On This Day...

  • 2011: Thinking about our development practices — We’re gearing up for another Drupal project. This one is going to be interesting in terms of workflow. I’m working [...]
  • 2010: Passion — (click for a bigger version) My dad: As far as I can remember, I’ve always been surrounded by examples of passion. [...]
  • 2009: My Charity Connects: The A, B, Cs, of Boomers, X, Ys, Zs: Reaching Different Generations Through Social Media — This is a placeholder for the talk on “The A, B, Cs of Boomers, X, Ys, Zs: Reaching Different Generations [...]
  • 2008: Weekly review — It seems that all I did at work this week was struggle with CSS and HTML. (Darn you, IE6!) And [...]
  • 2008: A geek’s guide to Toronto — Toronto Reference Library Royal Ontario Museum Active Surplus Linux Caffe Ontario Science Centre Gino Ledesma (one of my friends from university) is in Toronto for [...]
  • 2006: Camels — Here’s a tidbit from “Communication of Innovations” by Everett Rogers: “For instance, there are 6,000 Arabic words dealing with camels, including ninety [...]
  • 2006: My family’s moving — My sister’s having her next Carnivore Night party at the new house. It boggles the mind, actually. I’d lived all my [...]
  • 2006: Carnivore Night XXXVII: Magdalo at Magdiwang — My sister just sent me another great invitation to another great party. =) She’s an awesome cook and entertainer. Way [...]
  • 2006: Ruby — Somewhere along the way, I seem to have turned into a Ruby geek. I spent the day converting most of my [...]
  • 2004: Moonlight — The smog-choked and world-weary sky shrouded the moon and she was glad of that, glad of the blurred shadows she faded [...]
  • 2004: “After Life” — The funeral procession slowly winds its way through the rain, oblivious to the struggling man desperately trying to claw his way [...]
  • 2004: “Access Patterns Organize Data” — Old Dominion University researchers have devised a method that mimics the brain’s ability to order information so that connections can be automatically [...]
  • 2004: “What Is Google’s Secret Weapon? An Army of Ph.D.’s” — Google, the next challenger to Microsoft’s dominance in personal computing, may have an advantage in that its entire culture is infused with [...]
  • 2003: Formal wear — Our measurements for dresses for Ching’s wedding were taken today. I flipped through the magazines and books there, but didn’t really [...]

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging