|
|
|
|
@ -74,12 +74,13 @@ Of course it will blow in my face if I did not cache the results |
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
|
(setq max-lisp-eval-depth 10000000) ; burn baby burn |
|
|
|
|
(setq cache nil) |
|
|
|
|
(defun cache-result (fun pos) |
|
|
|
|
(let ((c (assoc pos cache))) |
|
|
|
|
(defun cache-result (fun &rest r) |
|
|
|
|
(let ((c (assoc (cons fun r) cache))) |
|
|
|
|
(if c (cdr c) |
|
|
|
|
(let ((res (funcall fun pos))) |
|
|
|
|
(push (cons pos res) cache) |
|
|
|
|
(let ((res (apply fun r))) |
|
|
|
|
(push (cons (cons fun r) res) cache) |
|
|
|
|
res )))) |
|
|
|
|
|
|
|
|
|
(advice-add 'timelines-at :around 'cache-result) |
|
|
|
|
|
|
|
|
|
(defun timelines-at (pos) |
|
|
|
|
@ -95,3 +96,5 @@ Of course it will blow in my face if I did not cache the results |
|
|
|
|
|
|
|
|
|
#+RESULTS: |
|
|
|
|
: 1537373473728 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|