Archived
1
0
Fork 0
This repository has been archived on 2024-10-19. You can view files and clone it, but cannot push or open issues or pull requests.
emacs/org/config-org-capture.el

63 lines
2.3 KiB
EmacsLisp
Raw Normal View History

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; inspiration for conditional capture template : https://storax.github.io/blog/2016/05/02/org-capture-tricks/
; helper functions
(defvar my-capture-prmt-history nil
"History of prompt answers for org capture.")
(defun my/prmt (prompt variable)
"PROMPT for string, save it to VARIABLE and insert it."
(make-local-variable variable)
(set variable (read-string (concat prompt ": ") nil my-capture-prmt-history)))
(defun my/inc (what text &rest fmtvars)
"Ask user to include WHAT. If user agrees return TEXT."
(when (y-or-n-p (concat "Include " what "?"))
(apply 'format text fmtvars)))
(defun my/inc_date (what prefix)
"Ask user to include a date. If user agrees prompt for date."
(when (y-or-n-p (concat "Include " what "?"))
(concat prefix (org-time-stamp nil))))
; orgmode capture templates
(setq org-capture-templates '(
("d" "TODO (Main)" entry
(file "~/org/_todo.org")
2024-07-28 16:04:59 +00:00
(file "~/org/_org-capture-templates/template_todo.org")
:prepend t
:immediate-finish "f"
:jump-to-captured "t"
)
("s" "TODO (Slipbox)" entry
(file "~/org/_slipbox.org")
2024-07-28 16:04:59 +00:00
(file "~/org/_org-capture-templates/template_slipbox.org")
:prepend t
:immediate-finish "f"
:jump-to-captured "t"
)
("h" "Health")
2024-03-10 17:32:48 +00:00
("hc" "Couples")
("hcd" "Appointment noteworthy developments / [time] in review"
entry (file "~/org/_slipbox.org")
2024-08-08 19:34:37 +00:00
(file "~/org/_org-capture-templates/template_couples_apt_developments.org")
2024-03-10 17:32:48 +00:00
:immediate-finish "f"
:jump-to-captured "t"
:unnarrowed "t"
:prepend "t"
)
("hm" "Mike")
("hmd" "Appointment noteworthy developments / [time] in review"
entry (file "~/org/_slipbox.org")
(file "~/org/_org-capture-templates/template_therapy_apt_developments.org.org")
:immediate-finish "f"
:jump-to-captured "t"
:unnarrowed "t"
:prepend "t"
)
("m" "Music import (beets)" entry
(file "~/org/_slipbox.org")
2024-07-28 16:33:22 +00:00
(file "~/org/_org-capture-templates/template_beets.org")
:prepend t
:immediate-finish "f"
:jump-to-captured "t"
)
))