Add capture template for quick notes

Am adding lots of quick notes, a capture template should be helpful here.
This commit is contained in:
Daniel Borchmann 2025-11-16 17:52:45 +01:00
parent 6565ad5933
commit b798b13a94
No known key found for this signature in database
GPG Key ID: 50EA937BF472ADD1
2 changed files with 24 additions and 0 deletions

View File

@ -731,6 +731,7 @@ split horizontally again, but this extra work should not matter much."
db/find-parent-task db/find-parent-task
db/ensure-running-clock db/ensure-running-clock
db/save-current-org-task-to-file db/save-current-org-task-to-file
db/goto-quick-notes
db/org-remaining-effort-of-current-item db/org-remaining-effort-of-current-item
db/org-cmp-remaining-effort db/org-cmp-remaining-effort
org-dblock-write:db/org-workload-report org-dblock-write:db/org-workload-report
@ -1406,6 +1407,12 @@ accordingly."
:clock-in t :clock-in t
:clock-resume t :clock-resume t
:empty-lines-before 1 :empty-lines-before 1
:empty-lines-after 1)
("q" "Quick note"
plain
(function db/goto-quick-notes)
"- [ ] %?"
:empty-lines-before 1
:empty-lines-after 1)))) :empty-lines-after 1))))
;; Babel ;; Babel

View File

@ -459,6 +459,23 @@ Via %%(with-temp-buffer (db/org-add-link-to-current-clock) (string-trim (buffer-
(delete-char -1)) (delete-char -1))
(insert "\n\n")))) (insert "\n\n"))))
(defun db/goto-quick-notes ()
"Go to position where next quick note should be inserted.
Quick notes are inserted into `db/org-default-refile-file', directly
before the first page feed character. Quick notes are expected to be
inserted as list items."
(unless (file-writable-p db/org-default-refile-file)
(user-error "Default refile file «%s» not writable" db/org-default-refile-file))
(set-buffer (find-file db/org-default-refile-file))
(unless (search-forward-regexp "^\f" nil t)
(user-error "No page feed found in default refile file"))
(beginning-of-line)
(open-line 2))
;;; Refiling ;;; Refiling