Skip to content

Instantly share code, notes, and snippets.

@commander-trashdin
Created May 25, 2020 00:15
Show Gist options
  • Save commander-trashdin/40978ed2e44060a3b646e20e7dee17ac to your computer and use it in GitHub Desktop.
Save commander-trashdin/40978ed2e44060a3b646e20e7dee17ac to your computer and use it in GitHub Desktop.
(defun parse-annotation-lines (list)
"Pull out header and item information from LIST."
(let (acc (header-is-next nil) (item-is-next nil) (current-page))
(nreverse
(dolist (element list acc)
(cond (header-is-next
(push (make-parse-entry *header+ element current-page) acc)
(setq header-is-next nil))
(item-is-next
(push (make-parse-entry *item+ element current-page) acc)
(setq item-is-next nil))
((is-page-line element)
(setq current-page
(string-to-number
(substring element (match-beginning 1))))))
(setq header-is-next (is-header-line element))
(setq item-is-next (is-item-line element))))))
(defun map-entries-to-org-mode (list)
(mapcar 'map-entry-to-orgmode list))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment