29 lines
1.0 KiB
Org Mode
29 lines
1.0 KiB
Org Mode
#+TITLE: Custom Elisp Functions
|
|
|
|
As of now, I haven't added anything here, though I do expect to start adding some custom functions as I learn more about Elisp.
|
|
|
|
* Capture Template Functions
|
|
|
|
These functions are for my org roam daily capture template.
|
|
|
|
#+begin_src emacs-lisp
|
|
(defun jm/daily-todos-priority-tasks-helper ()
|
|
(let ((item-priority (org-entry-get nil "PRIORITY"))
|
|
(item-name (org-entry-get nil "ITEM"))
|
|
(item-id (car (org-property-values "ID"))))
|
|
(when (and item-id (equal priority item-priority))
|
|
(format "- [ ] [[id:%s][%s]]" item-id item-name))))
|
|
|
|
(defun jm/daily-todos-get-priority-tasks (priority files)
|
|
(mapconcat #'identity
|
|
(delq nil (org-map-entries
|
|
#'jm/daily-todos-priority-tasks-helper
|
|
"TODO=\"TODO\""
|
|
files)) "\n"))
|
|
|
|
(defun jm/daily-todos-dynamic-habits (habit week-days)
|
|
(let ((today (downcase (format-time-string "%a"))))
|
|
(when (seq-contains-p week-days today) habit)))
|
|
#+end_src
|
|
|