Compare commits

...

8 Commits

Author SHA1 Message Date
Daniel - 74c8d95381
Remove obsolete Open tasks agenda view
Haven't used it for a long time now.
2022-06-20 18:21:18 +02:00
Daniel - 2ee4de5937
Remove explicit sorting settings in custom agendas
Those match the current value of `org-agenda-sorting-strategy` and are thus
redundant.  Removing those settings also allows to customize the order of items
in those views.
2022-06-20 18:18:56 +02:00
Daniel - aa7623ca7c
Include complex tasks in Backlog agenda in separate section
This is a compromise to have a list of all complex tasks but not cluttering the
list of actionable items with them.
2022-06-20 18:14:14 +02:00
Daniel - 8917d2d44b
Revert "Include complex tasks in main Backlog agenda view"
This reverts commit 690d16cdab.

Do not include complex tasks in the backlog agenda, as complex tasks are no
actionable items, but the backlog agenda should only list things that can and
should be done.  Stuck complex tasks are shown in the Project agenda, and a list
of all others might only be necessary during reviews – but when complex tasks
need reviews (apart from when they are stuck), they should have a NOTE sub-item.
2022-06-20 18:07:07 +02:00
Daniel - f3186b45f7
Allow limiting number of parent ascents when listing backlinks
Sometimes only the backlinks to the items itself might be interesting, or
backlinks to the current item and its direct parent.  To allow for easy
insertion of dynamic backlink blocks in those cases as well, include a
:parent-depth parameter.  The default value of nil means no limit is imposed, as
has been the case until now.
2022-06-20 18:01:11 +02:00
Daniel - 690d16cdab
Include complex tasks in main Backlog agenda view
This is not optional yet, but without an explicit GOAL tag it's hard to do
better.
2022-06-20 17:44:14 +02:00
Daniel - 7bba7ffbab
Remove obsolete REGULAR tag from definition of stuck tasks 2022-06-20 17:44:04 +02:00
Daniel - d7bf414fd5
Remove list of open tasks from project agenda
This list only shows complex tasks, i.e., tasks with sub-items, and is therefore
not a faithful indicator for overwork (this was the original intention to have
this list).  A better indicator might be to check the Backlog Agenda, but this
list might contain items far in the future and could thus also not be a valid
indicator for overwork.
2022-06-20 17:18:11 +02:00
2 changed files with 43 additions and 35 deletions

28
init.el
View File

@ -1114,7 +1114,7 @@ respectively."
;; here is that projects that have an explicit SCHEDULED entry
;; should not be considered before this date is due.
org-stuck-projects
'("+TODO=\"\"-DATE-REGULAR-HOLD-NOTE-TAGS={NOP\\|TOPIC\\|SOMEWHEN\\|TEMPLATE}-SCHEDULED>=\"<+1d>\""
'("+TODO=\"\"-DATE-HOLD-NOTE-TAGS={NOP\\|TOPIC\\|SOMEWHEN\\|TEMPLATE}-SCHEDULED>=\"<+1d>\""
("CONT" "TODO" "READ" "WAIT" "GOTO" "DELG" "ATTN")
()
"")
@ -1138,30 +1138,22 @@ respectively."
(org-deadline-warning-days 30)))
(tags-todo "TODO={CONT\\|ATTN}-HOLD-TIMESTAMP>\"<now>\""
((org-agenda-overriding-header "WIP List (TODO ∈ {CONT,ATTN}, not scheduled in the future)")
(org-agenda-sorting-strategy '(priority-down effort-up category-keep))
(org-agenda-todo-ignore-scheduled 'future)))
(tags-todo "TODO<>\"CONT\"-HOLD-SOMEWHEN-DATE-WAIT-TEMPLATE/-DONE"
((org-agenda-overriding-header "Next Actions List (not WIP, not scheduled)")
(org-tags-match-list-sublevels t)
(org-agenda-todo-ignore-scheduled t)
(org-agenda-sorting-strategy '(priority-down effort-up category-keep))))))
(org-agenda-todo-ignore-scheduled t)))))
("B" "Backlog"
((tags-todo "-HOLD-SOMEWHEN-DATE-PERIODIC-TEMPLATE/-DONE"
((org-agenda-overriding-header "Backlog items (next items list without periodic tasks; includes waiting-fors)")
(org-tags-match-list-sublevels t)
(org-agenda-sorting-strategy '(priority-down effort-up category-keep))))))
("O" "Open, non-periodic TODOs"
((tags-todo "-PERIODIC-SOMEWHEN-REGULAR-HOLD-TEMPLATE"
((org-agenda-overriding-header "List of open, non-periodic TODO items")
(org-use-tag-inheritance t)
(org-agenda-sorting-strategy '(deadline-down priority-down effort-up category-keep))
(org-agenda-prefix-format '((tags . "%-12c %-4e ")))))))
((org-agenda-overriding-header "Backlog: Actionable items (no periodic tasks; includes waiting-fors)")
(org-tags-match-list-sublevels t)))
(tags "TODO=\"\"-HOLD-SOMEWHEN-DATE-PERIODIC-NOTE-NOP-TOPIC-TEMPLATE"
((org-agenda-overriding-header "Backlog: Complex tasks (i.e., goals)")
(org-tags-match-list-sublevels t)))))
("U" "Unsupervised (Waiting, Missed Appointments, Hold)"
((tags-todo "WAIT-HOLD-SOMEWHEN"
((org-agenda-overriding-header "Waiting For List")
(org-agenda-todo-ignore-scheduled t)
(org-agenda-sorting-strategy '(priority-down effort-up category-keep))))
(org-agenda-todo-ignore-scheduled t)))
(tags-todo "DATE"
((org-agenda-overriding-header "Missed appointments (DATEs with timestamp in the past)")
(org-agenda-todo-ignore-timestamp 0)))
@ -1181,10 +1173,8 @@ respectively."
("P" "Current Projects and Topics"
((stuck ""
((org-agenda-overriding-header "Stuck Tasks")
((org-agenda-overriding-header "Stuck Complex Tasks")
(org-agenda-todo-ignore-scheduled 'future)))
(tags "TODO=\"\"-TAGS={NOP\\|TOPIC}-PERIODIC-NOTE-DATE-SOMEWHEN-HOLD-TEMPLATE-SCHEDULED>=\"<+1d>\""
((org-agenda-overriding-header "Open Tasks")))
(tags "TAGS={NOTE}-TODO={CANC\\|DONE}-HOLD-NOP"
((org-agenda-overriding-header "Project Notes (items explicitly tagged with NOTE but not NOP)")))
(tags "TODO=\"\"+TAGS={TOPIC}-SCHEDULED>=\"<+1d>\""

View File

@ -1020,29 +1020,36 @@ referenced in `org-agenda-text-search-extra-files'."
`(and ,link-expression ,org-ql-match)
link-expression)))))
(defun db/org--find-parent-marks ()
(defun db/org--find-parent-marks (&optional depth)
"Return list of markers of all parent headings of Org item at point.
The list will include a marker to the current headline as well.
The order of the list will be in ascending order of
positions (i.e., the marker for the headline with the lowest
level/position comes first)."
level/position comes first).
When optional parameter DEPTH is given, at most check only that
many parents. If DEPTH is zero, only return a list of a single
marker pointing to the current headline."
(unless (derived-mode-p 'org-mode)
(user-error "Not in Org mode buffer, cannot determine parent items"))
(save-mark-and-excursion
(save-restriction
(widen)
(let ((depth depth)) ; do not modify argument
(save-mark-and-excursion
(save-restriction
(widen)
;; Start at headline of current item
(or (org-at-heading-p)
(org-back-to-heading t))
;; Start at headline of current item
(or (org-at-heading-p)
(org-back-to-heading t))
;; Iterate over parents until at top-level
(let ((parent-markers (list (point-marker))))
(while (org-up-heading-safe)
(push (point-marker) parent-markers))
parent-markers))))
;; Iterate over parents until at top-level
(let ((parent-markers (list (point-marker))))
(while (and (org-up-heading-safe)
(or (null depth)
(<= 0 (cl-decf depth))))
(push (point-marker) parent-markers))
parent-markers)))))
(defun org-dblock-write:db/org-backlinks (params)
"Write table of backlinks for current item and its parent items as Org table.
@ -1052,17 +1059,26 @@ PARAMS may contain the following values:
:org-ql-match An org-ql-match expression in sexp syntax to filter
the resulting backlinks
:archives If non-nil, include archives"
:archives If non-nil, include archives
:parent-depth How many parents to check for backlinks; value of nil means
unrestricted, a value of 0 means only consider current item."
(let* ((org-ql-match (plist-get params :org-ql-match))
(archives (plist-get params :archives))
(parent-depth (plist-get params :parent-depth))
headlines output-lines)
(when (and (not (null parent-depth))
(not (integerp parent-depth)))
(user-error ":parent-depth is not an integer"))
;; Get all backlinks as list of Org mode IDs. Each list consists of the ID
;; of the headline (current or partent), followed by the IDs linking back to
;; that headline. If any of the headlines (current or parent) does not have
;; an ID, it will not be included in that list.
(setq headlines
(->> (db/org--find-parent-marks)
(->> (db/org--find-parent-marks parent-depth)
(mapcar #'(lambda (mark)
(org-with-point-at mark
(when-let ((id-at-point (org-id-get)))
@ -1121,7 +1137,9 @@ PARAMS may contain the following values:
(interactive)
(org-create-dblock
(list :name "db/org-backlinks"
:org-ql-match '(todo)))
:org-ql-match '(todo)
:parent-depth nil
:archives nil))
(org-update-dblock))
(org-dynamic-block-define "db/org-backlinks" #'db/org-insert-backlink-block)