Remove old tangling functions
This commit is contained in:
parent
663a5cf76a
commit
364753b025
38
init.org
38
init.org
|
@ -1829,43 +1829,8 @@ What if...
|
|||
:after chronometrist
|
||||
:load-path "~/.emacs.d/contrapunctus/chronometrist/elisp/")
|
||||
#+END_SRC
|
||||
|
||||
*** count-expressions
|
||||
*** tangling
|
||||
Wrote these two as potential alternatives to `org-babel-tangle', which was far slower than I'd like (took around 20s for chronometrist.org when I checked during the migration process, and 43s after the migration was complete.) These, on the other hand, are almost instant, but I don't use them anywhere because I run a sed script as a file local variable.
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun chronometrist-tangle ()
|
||||
(goto-char (point-min))
|
||||
(cl-loop with source
|
||||
while (not (eobp))
|
||||
when (looking-at-p (rx (and line-start (zero-or-more blank) line-end)))
|
||||
concat (progn
|
||||
(forward-line 1)
|
||||
(buffer-substring-no-properties
|
||||
(point)
|
||||
(cl-loop while (not (eobp))
|
||||
if (looking-at-p (rx (and line-start
|
||||
(zero-or-more blank)
|
||||
line-end)))
|
||||
do (cl-return (point))
|
||||
else do (forward-line 1)))) into source
|
||||
do (forward-line 1)
|
||||
finally do
|
||||
(with-current-buffer (find-file-noselect "chronometrist.el")
|
||||
(delete-region (point-min) (point-max))
|
||||
(insert source)
|
||||
(save-buffer))))
|
||||
|
||||
(defun chronometrist-tangle-sed ()
|
||||
(let* ((file-path (buffer-file-name
|
||||
(current-buffer)))
|
||||
(base (file-name-base file-path)))
|
||||
(when (equal "chronometrist.org" (file-name-nondirectory file-path))
|
||||
(start-process-shell-command
|
||||
"sed-tangle"
|
||||
(generate-new-buffer-name "sed-tangle")
|
||||
(format "sed -n '/#+BEGIN_SRC emacs-lisp$/,/#+END_SRC$/{//!p;}' ~s.org > ~s.el" base base)))))
|
||||
|
||||
#+END_SRC
|
||||
*** querying data
|
||||
An example of querying the Chronometrist file data - finding out how much time I've spent on tasks matching a certain criteria.
|
||||
|
||||
|
@ -2948,6 +2913,7 @@ With PREFIX argument and omitted CMD, prompt for command."
|
|||
("E" toggle-debug-on-error "tdoe")
|
||||
("Q" toggle-debug-on-quit "tdoq"))
|
||||
#+END_SRC
|
||||
|
||||
** applications
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defhydra my-app-hydra (:color blue)
|
||||
|
|
Loading…
Reference in New Issue