The story

The creativity that you apply and capture to assemble your system… this is where
all of the fun stuff is. Let me elaborate, everything in your artifacts are
valuable because they tell the story. Actually, they tell the story about a
story, a story that has yet to occur and also a story that has previously
occurred. It is here, where the actions lives, that all of those things are
learned, practiced, suffered accordingly from, and reveled in! In other words,
it is yet another story, a fun one.

If you haven’t noticed by now, either by hearing rumors, reading accounts, or
learning of it yourself: human beings are story-oriented. Your ability to
successfully function in and contribute to society will be directly proportional
to your ability to listen to stories, tell others’ stories, live your life such
that you have new stories to tell, and capture them in some form of persistent
storage. Stories grant us the power to learn from others wisdom that was
painfully acquired thousands of years ago, and it gives you a chance to
contribute the results of your hard work, for the future of humanity, too. A
belief system about the value of story-telling is essential, critical, and
mandatory to successfully achieve your goals with literate programming.

As I change, the story will change, and the action will change. The cycle will
never end.

Nevertheless, I will attempt to do my best here with the good part of me being
a flawless, rational, and logical human being to:

  • Deliver a supportable system
  • Deliver an adaptable system
  • Deliver an expandable system

A tiny org-mode literate programming Makefile

Basic build for a document:

INIT=.emacs.el
$(INIT): TC3F.org
	caffeinate -s time emacs --batch --no-init-file --load .org-mode.emacs.el --find-file TC3F.org --funcall org-babel-tangle --kill
TC3F.txt: $(INIT)
	caffeinate -s time emacs --batch --no-init-file --load .org-mode.emacs.el --find-file TC3F.org --funcall org-ascii-export-to-ascii --kill
TC3F.html: $(INIT)
	caffeinate -s time emacs --batch --no-init-file --load .org-mode.emacs.el --find-file TC3F.org --funcall org-html-export-to-html --kill
TC3F.pdf: $(INIT)
	caffeinate -s time emacs --batch --no-init-file --load .org-mode.emacs.el --find-file TC3F.org --funcall org-latex-export-to-pdf --kill
all: TC3F.txt TC3F.html TC3F.pdf
clean:
	rm $(INIT)
	rm TC3F.txt
	rm TC3F.html
	rm TC3F.pdf

Addendum: 14-06-13
Added caffeinate command.

Realtime web development with skewer and Emacs

[skewer-mode] provides live interaction with JavaScript, CSS, and HTML in a web browser. Expressions are sent on-the-fly from an editing buffer to be evaluated in the browser, just like Emacs does with an inferior Lisp process in Lisp modes.

Looks like a pretty nice option if you are used to Emacs already and so much more pleasant then running code in the Chrome/Firefox/IE REPL.

Easily setting system header arguments in org mode

A little helper function:

(defun gcr/set-org-system-header-arg (property value)
  "Easily set system header arguments in org mode.
PROPERTY is the system-wide value that you would like to modify.
VALUE is the new value you wish to store.
Attribution: URL http://orgmode.org/manual/System_002dwide-header-arguments.html#System_002dwide-header-arguments
"
  (setq org-babel-default-header-args
        (cons (cons property value)
              (assq-delete-all property org-babel-default-header-args))))

You know that a programming language has succeeded when people say that it is horrible… Emacs Lisp

Most new programming languages start out with the zest and zeal that everyone feels for things that are “fresh and new”. Eventually, like in every relationship, the “infatuation phase” ends and “real love” must begin or the relationship will move on.
What prefaces the latter phase is a period of acceptance of all the flaws of that language. Actually, it is a fine thing, as long as you don’t dwell on them (you have your flaws, too). It is a sign of growth and maturity. That is why whenever you see it for a programming language, then you know that it is “the real deal”, that a lot of people love it, and that it is worth your time.
See: WhyDoesElispSuck

Set your expectations for your org-mode system

This weekend I set up a Makefile for tangling and weaving one of my org documents. Wanting to automate it for the obvious reasons, I also wanted to have a “fresh” environment for the run. Actually, I was hoping that it would be faster, not just fresher.
Playing with the command line arguments for Emacs, I was stunned to get the tangling down to 30s. Could. Not. Believe. It. Down from 8 minutes! Then, I see the warning:

Insufficient requirements. Expected 8.2.6. Found 7.9.3

(From my memory, didn’t copy and paste it)
Uh oh. I screwed something up. Oops.
Glad I added a check!
All org users should have something like this in their code!

(when (not (version= (org-version) "8.2.6"))
  (display-warning
   'org-mode
   (concat
    "Insufficient requirements. Expected 8.2.6. Found " (org-version))
   :emergency))

There may be more
AddendunM 14-06-09
Thank you SHK and Alexander Baier for pointing out that I should be using version= instead of string-equal.

Lower casing your source block templates

org-mode has nice template expansion for its frequently used blocks via Easy Templates. I wanted them to be lower cased because my document won’t tangle with upper case block statements. Thorsten pointed out which variable needs to be configured. This approach is preferable because it it is temporary:

(mapc (lambda (asc)
        (let ((org-sce-dc (downcase (nth 1 asc))))
          (setf (nth 1 asc) org-sce-dc)))
      org-structure-template-alist)

org-scraps

Every org-mode literate programmer must at least become aware of org-scraps.
Studying and mastering each of them brings you further down the path of org-mode literate programming mastery.
Addendum:
Here is perhaps a better link.
These examples to reveal the evaluation model, which is helpful for understanding what exactly is possible with babel. For example, I like the use of a var binding to force evaluation before a computation is performed, unnamed source blocks may still tangle code, the noweb ref expansion without a newline clearly shows successfully integration between the noweb feature and the shell language, noweb variable index syntax, single line data blocks, examples of argument variable binding, obtaining values in code that are defined as properties by SHA1 id which is kind of radical when you stare at it, unnamed variables in a call, inline function call, and there I must stop. The file is 5960 lines long. It will take some time to work through it. Perhaps a better approach would be to a need first, though.