ALEC's a Language for Expressing Creativity

ALEC is the new configuration of my Emacs/Organization-Mode system. Just wanted to share some thoughts on the experience. The code says a lot, and the text, too, but I’m more interested in the experience.
For context, this is the next step of TC3F.
If nothing else, just know that the tangle time went down from 10m to 27 seconds :).

Continue reading “ALEC's a Language for Expressing Creativity”

Don't run mode hooks during org exports

binchen has a nice post about how to disable org mode hook execution during exports. It can be a surprise when you run in batch mode and your export breaks because of dependency failures. Oh yea, the major mode hooks run during export even though you personally are not opening a buffer, Emacs is doing so!
Here is his solution:

(defun is-buffer-file-temp ()
  (interactive)
  "If (buffer-file-name) is nil or a temp file or HTML file converted from org file"
  (let ((f (buffer-file-name))
        (rlt t))
    (if f
        (if (and (not (string-match temporary-file-directory f))
                 (not (file-exists-p (replace-regexp-in-string "\.html$" ".org" f))))
          (setq rlt nil)))
    rlt))

Interesting.

Org-Mode Details To Accompany Questions

The details that are likely to help questions to be answered on the org mailing list.

(print emacs-version)
(print org-version)
(print (pp-to-string org-babel-default-header-args))
(print (pp-to-string org-babel-default-header-args:R))

=

Eg:

"24.3.1"
"8.2.10"
"((:eval . \"always\")
 (:padline . \"yes\")
 (:noweb . \"no-export\")
 (:exports . \"both\")
 (:results . \"output replace\")
 (:comments . \"noweb\")
 (:session . \"none\")
 (:cache . \"no\")
 (:hlines . \"no\")
 (:tangle . \"no\"))
"
"((:session . \"*R*\"))
"

Edit a source block with its name shown in org

My preference is to rely upon heading property inheritance to define source block
names. That way, you can just do your work knowing “where” you are working and
keep it simple by not having to name everything. That was just fine until I
wrote a document where I needed to name each source block.
It gets easy to forget the source block’s name. Not the end of the world, but very nice to know.

(defun gcr/org-edit-src-code-plus-name ()
  "Edit the well-described source code block.
Attribution: URL `https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00778.html'"
  (interactive)
  (let* ((eop  (org-element-at-point))
         (name (or (org-element-property :name (org-element-context eop))
                  "ॐ"))
         (lang (org-element-property :language eop))
         (buff-name (concat "*Org Src " name "[" lang "]*")))
    (org-edit-src-code nil nil buff-name)))