Compare commits
8 Commits
a79c67404a
...
74c8d95381
Author | SHA1 | Date |
---|---|---|
Daniel - | 74c8d95381 | |
Daniel - | 2ee4de5937 | |
Daniel - | aa7623ca7c | |
Daniel - | 8917d2d44b | |
Daniel - | f3186b45f7 | |
Daniel - | 690d16cdab | |
Daniel - | 7bba7ffbab | |
Daniel - | d7bf414fd5 |
28
init.el
28
init.el
|
@ -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>\""
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue