2022-08-25 22:52:29 +00:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; helper for building agenda file lists
2023-04-08 16:53:12 +00:00
( defun my/load-org-agenda-files-recursively ( dir ) " Find all directories in DIR. "
2022-08-25 22:52:29 +00:00
( unless ( file-directory-p dir ) ( error " Not a directory `%s' " dir ) )
( unless ( equal ( directory-files dir nil org-agenda-file-regexp t ) nil )
( add-to-list 'org-agenda-files dir )
)
( dolist ( file ( directory-files dir nil nil t ) )
( unless ( member file ' ( " . " " .. " ) )
( let ( ( file ( concat dir file " / " ) ) )
( when ( file-directory-p file )
( load-org-agenda-files-recursively file )
)
)
)
)
)
2022-09-02 16:57:41 +00:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; set org habit status for yesterday and schedule for today. this is to facilitate adding "skipped" log entries for better reporting and tracking of habits
; this assumes youre operating on daily habits
2022-09-02 14:44:08 +00:00
; https://emacs.stackexchange.com/questions/9433/how-to-make-org-prompt-for-a-timestamp-when-changing-state-of-a-todo/63809
; https://stackoverflow.com/questions/25437069/how-can-i-mark-org-habits-as-done-in-the-past
2023-04-08 16:53:12 +00:00
( defun my/org-habit-with-date ( &optional arg )
2022-09-02 14:44:08 +00:00
( interactive " P " )
2022-09-02 16:57:41 +00:00
( setq my-activation-time ( current-time ) )
2022-09-02 14:44:08 +00:00
( cl-letf* ( ( org-read-date-prefer-future nil )
2022-09-02 16:57:41 +00:00
( org-popup-calendar-for-date-prompt nil )
( my-current-time ( org-read-date t t nil " when: " nil " -1d " nil ) )
2022-09-02 14:44:08 +00:00
( ( symbol-function 'current-time )
#' ( lambda ( ) my-current-time ) )
( ( symbol-function 'org-today )
#' ( lambda ( ) ( time-to-days my-current-time ) ) )
( ( symbol-function 'org-current-effective-time )
#' ( lambda ( ) my-current-time ) )
( super-org-entry-put ( symbol-function 'org-entry-put ) )
( ( symbol-function 'org-entry-put )
#' ( lambda ( pom property value )
( print property )
( if ( lambda ( or ( equal property " LAST_REPEAT " ) ( equal property " SCHEDULED " ) ) )
( let ( ( my-value ( format-time-string ( org-time-stamp-format t t ) my-current-time ) ) )
( funcall super-org-entry-put pom property my-value ) )
( funcall super-org-entry-put pom property value )
) ) ) )
2022-09-02 16:57:41 +00:00
( if ( eq major-mode 'org-agenda-mode ) ( org-agenda-todo arg ) ( org-todo arg ) )
2022-09-02 14:44:08 +00:00
)
2022-09-02 16:57:41 +00:00
( if ( eq major-mode 'org-agenda-mode ) ( org-agenda-schedule arg my-activation-time ) ( org-schedule arg my-activation-time ) )
2022-09-02 14:44:08 +00:00
)
2022-08-25 22:52:29 +00:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; org-agenda tuning (view stuff only)
;; Remove completed deadline tasks from the agenda view
( setq org-agenda-skip-deadline-if-done t )
;; Remove completed scheduled tasks from the agenda view
( setq org-agenda-skip-scheduled-if-done t )
;; Remove completed items from search results
( setq org-agenda-skip-timestamp-if-done t )
2022-09-16 13:20:12 +00:00
;; Dont show deadline pre-warning if already scheduled (scheduled means the time when you /start work/ on a todo ; this is very different than norms
;; see https://orgmode.org/manual/Deadlines-and-Scheduling.html
( setq org-agenda-skip-deadline-prewarning-if-scheduled t )
2022-08-26 19:58:28 +00:00
;; dont tend to care about tag inheritance outside of search
( setq org-agenda-use-tag-inheritance nil )
2022-09-02 14:44:08 +00:00
;; add new option to update habit for yesterday and reschedule it as active today
( add-hook 'org-agenda-mode-hook
( lambda ( )
2023-04-08 16:53:12 +00:00
( local-set-key ( kbd " y " ) 'my/org-habit-with-date ) ) )
2023-02-12 22:15:30 +00:00
( setq org-agenda-use-time-grid nil )
2023-04-08 15:40:14 +00:00
( setq org-agenda-window-setup " current-window " )
2022-08-25 22:52:29 +00:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Set some org agendas/dashboards
( setq org-agenda-sorting-strategy
' (
2023-08-30 12:48:18 +00:00
( agenda habit-down scheduled-up deadline-up scheduled-up timestamp-up time-up priority-down category-keep )
2022-08-25 22:52:29 +00:00
( todo habit-up time-down scheduled-down deadline-down todo-state-down priority-down alpha-up )
( tags priority-down category-keep )
( search category-keep )
)
)
2022-08-26 19:58:28 +00:00
( setq org-agenda-file-regexp " \\ ` [^.].* \\ .org \\ ' " )
( setq org-agenda-files ( list
2022-09-12 20:21:52 +00:00
" ~/org/_index.org "
2023-02-12 22:15:30 +00:00
" ~/org/orgzly/_todo.org "
2023-02-12 22:59:07 +00:00
" ~/org/orgzly/_slipbox.org "
2022-08-26 19:58:28 +00:00
) )
2024-07-27 13:30:48 +00:00
2022-08-26 19:58:28 +00:00
2023-04-15 16:57:15 +00:00
; use *all* org agenda files as refile targets
( setq org-refile-targets
' ( ( nil :maxlevel . 3 )
( org-agenda-files :maxlevel . 3 ) ) )
2022-09-15 19:06:04 +00:00
( require 'org-super-agenda )
( org-super-agenda-mode )
( setq org-super-agenda-groups
' (
2023-04-07 23:35:28 +00:00
( :name " Health "
2022-09-15 19:06:04 +00:00
:and ( :habit t
2023-04-07 23:35:28 +00:00
:tag " health " ) )
2022-09-15 19:06:04 +00:00
( :name " House "
:and ( :habit t
:tag " house " ) )
2023-02-12 23:40:21 +00:00
( :name " Meds "
:and ( :habit t
:tag " meds " ) )
2024-03-07 17:59:41 +00:00
( :name " Health "
:and ( :tag " health " :tag " homework " ) )
( :name " Misc "
:tag " homework " )
2023-04-07 23:35:28 +00:00
( :name " Health "
2022-09-15 19:06:04 +00:00
:and ( :todo ( " WIP " " READY " )
2023-04-07 23:35:28 +00:00
:tag " health " ) )
2024-03-10 19:15:43 +00:00
( :order 200 :auto-parent " t " )
2023-04-22 20:24:46 +00:00
( :name " Slipbox "
:and ( :todo ( " WIP " " READY " )
:tag " slipbox " ) )
2022-09-15 19:06:04 +00:00
( :name " Personal "
2023-04-22 20:24:46 +00:00
:and ( :todo ( " WIP " " READY " )
:tag " personal " ) )
( :name " To Do "
2022-09-15 19:06:04 +00:00
:todo ( " WIP " " READY " ) )
2024-08-12 18:14:30 +00:00
( :name " Slipbox " :tag " slipbox " )
2024-03-10 19:15:43 +00:00
( :name " Health " :tag " health " )
2023-08-11 15:50:11 +00:00
( :name " Personal " :tag " personal " )
2022-09-15 19:06:04 +00:00
( :name " To Do " :priority>= " C " )
2023-04-13 15:41:09 +00:00
( :name " Low Priority " :priority< " C " )
) )
2022-09-15 19:06:04 +00:00
2022-08-25 22:52:29 +00:00
( setq org-agenda-custom-commands
' (
2023-04-15 15:00:11 +00:00
( " r " " Personal (Combined) "
2022-08-25 22:52:29 +00:00
(
( agenda " " (
2022-09-15 19:06:04 +00:00
( org-agenda-overriding-header " Scheduled " )
2023-02-12 22:59:07 +00:00
( org-agenda-remove-tags t )
2023-04-13 19:51:19 +00:00
( org-deadline-warning-days 14 )
( org-agenda-entry-types ' ( :deadline :scheduled ) )
2022-08-25 22:52:29 +00:00
) )
2022-08-26 19:58:28 +00:00
( agenda " " (
( org-agenda-overriding-header " Habits " )
2023-02-12 23:40:21 +00:00
( org-agenda-files ( list " ~/org/orgzly/_habits.org "
2024-10-01 15:06:11 +00:00
" ~/org/orgzly/_meds.org " ) )
2022-09-02 13:33:45 +00:00
( org-agenda-remove-tags t )
2022-08-26 19:58:28 +00:00
) )
2024-03-07 17:59:41 +00:00
( tags-todo " +homework " (
( org-agenda-overriding-header " Homework " )
( org-agenda-remove-tags t )
) )
( tags-todo " +TODO= \" WIP \" &-homework " (
2022-08-25 22:52:29 +00:00
( org-agenda-overriding-header " WIP " )
2023-02-12 22:59:07 +00:00
( org-agenda-remove-tags t )
2022-08-25 22:52:29 +00:00
) )
2024-03-07 17:59:41 +00:00
( tags-todo " +TODO= \" READY \" &-homework " (
2022-08-25 22:52:29 +00:00
( org-agenda-overriding-header " Ready " )
2023-02-12 22:59:07 +00:00
( org-agenda-remove-tags t )
2022-08-25 22:52:29 +00:00
) )
2024-03-10 19:15:43 +00:00
( tags-todo " -TODO= \" WIP \" &-TODO= \" READY \" &-homework " (
2022-09-15 19:06:04 +00:00
( org-agenda-overriding-header " " )
2023-02-12 22:59:07 +00:00
( org-agenda-remove-tags t )
2022-08-25 22:52:29 +00:00
) )
)
)
2023-04-15 15:00:11 +00:00
( " h " " Personal (Habits/Scheduled) "
(
( agenda " " (
( org-agenda-overriding-header " Scheduled " )
( org-agenda-remove-tags t )
( org-deadline-warning-days 14 )
( org-agenda-entry-types ' ( :deadline :scheduled ) )
) )
( agenda " " (
( org-agenda-overriding-header " Habits " )
( org-agenda-files ( list " ~/org/orgzly/_habits.org "
2024-10-01 15:06:11 +00:00
" ~/org/orgzly/_meds.org " ) )
2023-04-15 15:00:11 +00:00
( org-agenda-remove-tags t )
) )
)
)
( " t " " Personal (Tasks) "
(
2024-03-07 17:59:41 +00:00
( tags-todo " +homework " (
( org-agenda-overriding-header " Homework " )
( org-agenda-remove-tags t )
) )
( tags-todo " +TODO= \" WIP \" &-homework " (
2023-04-15 15:00:11 +00:00
( org-agenda-overriding-header " WIP " )
( org-agenda-remove-tags t )
) )
2024-03-07 17:59:41 +00:00
( tags-todo " +TODO= \" READY \" &-homework " (
2023-04-15 15:00:11 +00:00
( org-agenda-overriding-header " Ready " )
( org-agenda-remove-tags t )
) )
2024-03-07 17:59:41 +00:00
( tags-todo " -TODO= \" WIP \" &-TODO= \" READY \" &-homework " (
2023-04-15 15:00:11 +00:00
( org-agenda-overriding-header " " )
( org-agenda-remove-tags t )
) )
)
)
2022-08-25 22:52:29 +00:00
( " d " " Destiny "
(
( agenda " " (
( org-agenda-start-on-weekday 2 )
2022-09-15 20:54:42 +00:00
( org-agenda-overriding-header " Scheduled " )
2022-08-29 18:12:13 +00:00
( org-agenda-files ( list " ~/org/games/games_destiny.org " ) )
2022-08-25 22:52:29 +00:00
) )
2022-09-15 20:54:42 +00:00
( alltodo " " (
( org-agenda-overriding-header " " )
2022-08-29 18:12:13 +00:00
( org-agenda-files ( list " ~/org/games/games_destiny.org " ) )
2022-09-15 20:54:42 +00:00
( org-super-agenda-groups ' (
( :name " WIP " :and ( :todo " WIP " :not ( :tag " crafting " ) ) )
( :name " READY " :and ( :todo " READY " :not ( :tag " crafting " ) ) )
( :name " Low Priority " :not ( :tag " crafting " ) )
( :name " Patterns Needed " :not ( :property ( " resonance_needed " " 0 " ) ) )
( :name " Barrel " :not ( :property ( " barrel " " true " ) ) )
( :name " Magazine " :not ( :property ( " magazine " " true " ) ) )
( :name " Perk 1 " :not ( :property ( " perk_1 " " true " ) ) )
( :name " Perk 2 " :not ( :property ( " perk_2 " " true " ) ) )
( :name " Frame " :not ( :property ( " frame " " true " ) ) )
2022-09-18 14:17:49 +00:00
( :name " Weapon Leveling " :not ( :property ( " level_at_all_perks_or_higher " " true " ) ) )
2022-09-15 20:54:42 +00:00
( :name " Enhanced Perk 1 " :not ( :property ( " enhanced_perk_1 " " true " ) ) )
( :name " Enhanced Perk 2 " :not ( :property ( " enhanced_perk_2 " " true " ) ) )
( :name " Masterwork " :not ( :property ( " masterworked " " true " ) ) )
) )
2022-08-25 22:52:29 +00:00
) )
)
)
)
2022-08-26 13:46:23 +00:00
)
2023-04-11 16:08:54 +00:00