From c63f5f0fec205962ce9037510fb7de3efba4ee01 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 26 May 2022 23:13:28 -0700 Subject: [PATCH] [oni-org] Add function to write oni-project-steps dblock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows me to run ‘org-dynamic-block-insert-dblock’ instead of having to write it manually each time. --- oni-org/oni-org.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el index 9893754..a1f9336 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2022.0523.185109 +;; Version: 2022.0526.181315 ;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org org-contrib org-bullets org-edna diminish all-the-icons olivetti mixed-pitch) ;; This program is free software; you can redistribute it and/or modify @@ -579,13 +579,7 @@ also move point to the start of the heading." (setq org-agenda-window-setup 'only-window) (setq org-agenda-custom-commands - '(("i" - "Inbox: The giant list of things that I haven’t sorted through yet." - todo "" - ((org-agenda-files (list org-default-notes-file)) - (org-agenda-cmp-user-defined (lambda (_ _) -1)) - (org-agenda-sorting-strategy '(user-defined-up)))) - ("t" "Todo" tags-todo "TODO=\"TODO\"-CATEGORY=\"inbox\"+SCHEDULED=\"\"" + `(("t" "Todo at this computer" tags-todo ,(format "TODO=\"TODO\"+%s" (system-name)) ((org-overriding-columns-format "%TODO %46ITEM %1BLOCKED %Effort"))) ("r" "Reading list" tags-todo "TODO=\"READ\"+SCHEDULED=\"\"-Effort=\"\"" ((org-overriding-columns-format "%8CATEGORY %ITEM %3EFFORT") @@ -860,7 +854,14 @@ This is an around advice for ‘org-html--svg-image’ as FUN." "\n")) (org-update-statistics-cookies nil))) +(defun oni-org-insert-project-steps () + "Create a dynamic block capturing the steps in a project." + (interactive) + (org-create-dblock '(:name "oni-project-steps")) + (org-update-dblock)) + (defalias 'org-dblock-write:oni-project-steps 'oni-org-dblock-write-project-steps) +(org-dynamic-block-define "oni-project-steps" #'oni-org-insert-project-steps) ;;; Moving subtrees