Nice post to get you think about org-mode as a data vehicle.
Tag: Org mode
Line snippet helper for posting code
On the org list there are a few ways that people post code indicate the start and end of that code. This is my version that might work in any mode:
(defun gcr/insert-noticeable-snip-comment-line ()
"Insert a noticeable snip comment line (NSCL)."
(interactive)
(if (not (bolp))
(message "I may only insert a NSCL at the beginning of a line.")
(let ((ncl (make-string 70 ?✂)))
(newline)
(previous-line)
(insert ncl)
(comment-or-uncomment-region (line-beginning-position) (line-end-position)))))
ADDENDUM: 2014-06-22T10:18:59-0500: Added newline first
A must read overview of one person's org usage
This is a great, detailed overview of one person’s org usage.
Myself not having used agenda at all yet, it is nice to see such a thoughtful exposition, something seemingly common to org users.
Only use in-line footnotes unless your document is very very small
Footnotes in org-mode are really, really great. Before you really get into using them, take a bit of time to think about how you want to use them.
If you have 5 footnotes or less, then don’t think anymore about it. If more then read on.
This topic is not unique to org first of all, it just isn’t something that you consider much until it is too late. Once you get into the org lifecycle, you start tossing and slinging document and code fragments with ease, especially while refactoring. This is all find and well, until you realize that your footnotes will be left sad and alone, abandoned for some cruel fate. In particular, it will break your document.
The better way is to define them all in-line; that will allow simple and easy refactoring in a quite pleasant manner.
Forgot a key point, as I only revisited this today: also generate random IDs. The kind folks in the org community on-list explained this to me. That prevents name collisions. Here is what you need:
(setq org-footnote-define-inline +1)
(setq org-footnote-auto-label 'random)
(setq org-footnote-auto-adjust nil)
ADDENDUM: 2014-06-22T09:07:09-0500
As FUCO1 pointed out, there was something wrong with my approach as I was still using randomly generated IDs. That was my intent. What I wanted was in-line and still reference-able footnote definitions, but without adding them to the Footnote section/heading. After reading the code, I see now the right setting; it was the above plus no auto-adjusting the footnotes. I just updated the code to correct that.
Be sure to configure org-startup-folded for large org documents
Be sure to configure org-startup-folded for large org documents.
org quite nicely handles navigating a collapsed document. Large ones though get a nagging slowdown, and nofold remedies this.
A tiny noweb-ref tangling example
Here is a simple, simple example so you can see it and believe it:
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.
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))))
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.