From 817060db2c5fb4b65473e13dfddfe1b0760ab464 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 25 May 2023 00:14:32 -0700 Subject: [PATCH] [oni-org] Add function that I want to save and have no place for yet --- oni-org/oni-org.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el index b0f95d4..6dd9c66 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -1170,5 +1170,27 @@ placed above TARGET. Otherwise it will be placed below it." (quit nil))))) (widen)))))) +(defun oni-org-clock+post-drawer () + (if (and (markerp org-clock-hd-marker) + (marker-buffer org-clock-hd-marker)) + (progn (set-buffer (marker-buffer org-clock-hd-marker)) + (org-capture-put-target-region-and-position) + (widen) + (goto-char org-clock-hd-marker) + (let ((end (org-entry-end-position))) + (while (search-forward ":END:" end t)))) + (user-error "No running clock that could be used as capture target"))) + +(defun init-find-weekly-review-file () + (interactive) + (find-file (format-time-string "u:/documents/gtd/weekly-reviews/%Y-%W.org")) + (if (= (point-min) (point-max)) + (progn + (insert (format-time-string "#+TITLE: Weekly Review Report for Week %-W %Y\n")) + (insert "\n") + (insert "See [[file:u:/documents/gtd/checklists/weekly-review.org][Weekly Review Checklist]]\n") + (insert "\n")) + (goto-char (point-min)))) + (provide 'oni-org) ;;; oni-org.el ends here