diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el index 7a95721..dd28a4f 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2023.0409.214302 +;; Version: 2023.0411.202312 ;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org org-contrib org-bullets org-edna diminish all-the-icons olivetti form-feed org-pretty-table) ;; This program is free software; you can redistribute it and/or modify @@ -600,16 +600,7 @@ also move point to the start of the heading." (setq org-agenda-dim-blocked-tasks 'invisible) (setq org-agenda-custom-commands - `(("t" . "Things to do") - ("tt" "Todo at this computer" tags-todo ,(format "@%s|@computer|@emacs/TODO" (system-name)) - ((org-overriding-columns-format "%TODO %46ITEM %1BLOCKED %Effort"))) - ("tf" "Fun things to do" tags-todo "+fun") - ;; ("r" "Reading list" tags-todo "TODO=\"READ\"+SCHEDULED=\"\"-Effort=\"\"" - ;; ((org-overriding-columns-format "%8CATEGORY %ITEM %3EFFORT") - ;; (org-agenda-sorting-strategy '(priority-down effort-up)) - ;; (org-agenda-prefix-format " (%3e) %i %-12:c"))) - ;; ("R" "Reading list (requires estimating)" tags-todo - ;; "TODO=\"READ\"+Effort=\"\"") + `(("t" "Todo" tags-todo "TODO=\"TODO\"-CATEGORY=\"project\"+(SCHEDULED<\"\"|TODO=\"TODO\"-CATEGORY=\"project\"+SCHEDULED=\"\")") ("r" . "Reading") ("rc" "Casual reading" tags-todo "TODO=\"READ\"+casual") ("rn" "Noteworthy reading" tags-todo "TODO=\"READ\"+note") @@ -776,6 +767,26 @@ After running it once remove it from `org-capture-after-finalize-hook'." (org-goto-first-child) (list (point-marker)))) +(defun org-edna-condition/day-of-week? (neg weekday) + (let ((condition (not (= (string-to-number (format-time-string "%u")) weekday)))) + (when (xor condition neg) + "Not the right day."))) + +(defun org-edna-condition/night-time? (neg) + "A condition for ‘org-edna’ see if it's what I consider nighttime." + (let* ((hour (nth 2 (decode-time))) + (condition (or (> hour 20) + (< hour 8)))) + (when (xor condition neg) + "Too late!"))) + +(defun org-edna-condition/business-hours? (neg timezone) + "A condition for ‘org-edna’ to see if it's during regular business hours." + (let* ((hour (nth 2 (decode-time nil timezone))) + (condition (> 9 hour 18))) + (when (xor condition neg) + (format "Outside of business hours in %s!" timezone)))) + ;;; Refile (defun oni-org-refile-to-top ()