This post reveals a nice function
comment-indent-new-line which gives you the
right kind of indentation for block comments. That got me wondering if my
enter key-binding should do different things depending upon whether or not the
cursor is inside of a comment block or not. Specifically, if it is, then call
the aforementioned function, else call the normal binding. This seems that it
might be an improvement
This post explains how to check if the cursor is inside of a comment block:
It is not nil when the point (cursor) is inside of a comment block.
Great to know.
I decided not to make this change yet, but, I wanted to capture how, here.
This announcement is pretty exciting because it reveals a new-to-me take on literate programming. The style is to store a single file as a source, and render disparate parts of that file in different buffers in a mode correct for the content.
For example you may have an Emacs Lisp file serve as the source and two separate buffers, one Emacs Lisp and one Organization (Mode), to work on the content, with all of the mode-specific assistance.
Is it a new idea? It is new to me and I am curious to find out about other approaches people have taken to realize this style.
Here is an overview and a nice video that demonstrates it.
Basic build for a document:
caffeinate -s time emacs --batch --no-init-file --load .org-mode.emacs.el --find-file TC3F.org --funcall org-babel-tangle --kill
caffeinate -s time emacs --batch --no-init-file --load .org-mode.emacs.el --find-file TC3F.org --funcall org-ascii-export-to-ascii --kill
caffeinate -s time emacs --batch --no-init-file --load .org-mode.emacs.el --find-file TC3F.org --funcall org-html-export-to-html --kill
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
Added caffeinate command.
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
(cons (cons property value)
(assq-delete-all property org-babel-default-header-args))))
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"))
"Insufficient requirements. Expected 8.2.6. Found " (org-version))
There may be more…
Thank you SHK and Alexander Baier for pointing out that I should be using version= instead of string-equal.
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)))