How Fast Can You Tangle In Org-Mode?

Last year I converted my Emacs Literate Configuration File from a complicated document full of out-of-order noweb objects to a simple sequential document that took the tangle times down from 3-10 minutes (because of how I set up my document not because of Org-Mode itself!!!) down to 30-90 seconds. But who doesn’t want more speed? I didn’t at least until I read this article which led me to reading this article and this page on garbage collection.

I tangle my config files what feels like every few minutes at least when I am playing around with stuff. So here is some code to effectively avoid garbage collection when tangling. It speeds up tangling on my computer when I tangle the same document in a row five or ten times so I’m happy but that clearly isn’t a detailed analysis.

Here is the code:

(setq help/default-gc-cons-threshold gc-cons-threshold)
(defun help/set-gc-cons-threshold (&optional multiplier notify)
  "Set `gc-cons-threshold' either to its default value or a
   `multiplier' thereof."
  (let* ((new-multiplier (or multiplier 1))
         (new-threshold (* help/default-gc-cons-threshold
                           new-multiplier)))
    (setq gc-cons-threshold new-threshold)
    (when notify (message "Setting `gc-cons-threshold' to %s"
                          new-threshold))))
(defun help/double-gc-cons-threshold () "Double `gc-cons-threshold'." (help/set-gc-cons-threshold 2))
(add-hook 'org-babel-pre-tangle-hook #'help/double-gc-cons-threshold)
(add-hook 'org-babel-post-tangle-hook #'help/set-gc-cons-threshold)

The Opposite of Forget Is Mindful Not Remember

When you forget a «person/place/thing/idea/though/memory», that which previously sat in your cognitive field is there no longer. When you become mindful of that «person/place/thing/idea/though/memory» again, it returns to your cognitive field. We call this “forgetting and remembering” something. But remember is the wrong word.

Continue reading “The Opposite of Forget Is Mindful Not Remember”

Somatic Experiencing Therapy

From Wikipedia:

Somatic experiencing is a form of alternative therapy aimed at relieving the
symptoms of post-traumatic stress disorder (PTSD) and other mental and
physical trauma-related health problems by focusing on the client's perceived
body sensations (or somatic experiences). It was created by trauma therapist
Peter A. Levine.

Yet Another Ag Hydra

(defhydra help/hydra/ag (:color blue
                                :hint nil)
  "
`ag', The Silver Searcher:
  Present in window:
    Search in folder:
      _j_ limit search by file type _k_ search in everything
    Search in project:
      _l_ limit search by file type _;_ search in everything
  Present in dired:
    Search in folder:
      _u_ limit search by file type _i_ search in everything
    Search in project:
      _o_ limit search by file type _p_ search in everything
  Other:
    _n_ close every other buffer _m_ close every buffer _q_ quit
"
  ("u" ag-dired-regexp)
  ("i" ag-dired)
  ("o" ag-project-dired-regexp)
  ("p" ag-project-dired)
  ("j" ag-files)
  ("k" ag)
  ("l" ag-project-files)
  (";" ag-project)
  ("n" ag-kill-other-buffers)
  ("m" ag-kill-buffers)
  ("q" nil))

Org-Mode Documents Can Generate PDFs Which Include Any Data Including Themselves

This Org-Mode document

#+LATEX_HEADER: \usepackage{attachfile}
Jon this is an Org-Mode file which generated a PDF which contains itself.
@@latex:\attachfile{orginorg.org}@@

Generates this pdf that contains itself. Open it with Adobe Acrobat (or some other tool that can handle embedded files).

You can include any data you want inside a PDF using attachfile and it is easy to extract that data.

It is a toy example but you can script everything to work with embedded data in PDF.

Continue reading “Org-Mode Documents Can Generate PDFs Which Include Any Data Including Themselves”