FIX compile warnings

This commit is contained in:
Nathan Dwarshuis 2022-04-11 18:30:39 -04:00
parent e0aed5179d
commit 6ee39fe91d
1 changed files with 43 additions and 34 deletions

View File

@ -712,17 +712,6 @@ be uncommitted if it is also incubated."
(-remove #'org-x-dag-id->buffer-children) (-remove #'org-x-dag-id->buffer-children)
(length))) (length)))
(defun org-x-dag-rank-leaf-goals (quarter ids)
(cl-flet
((score
(buckets id)
;; TODO what happens when I don't have a bucket?
(let ((idx (-elem-index (org-x-dag-id->bucket t id) (reverse buckets)))
(ntasks (org-x-dag-goal-count-tasks id)))
(list idx ntasks))))
(let ((bs (org-x-qtp-get-buckets quarter)))
(org-x-dag-ids-rank (score bs it) ids))))
;; planning state ;; planning state
;; TODO might be less tedious to just set the date and have functions handy ;; TODO might be less tedious to just set the date and have functions handy
@ -1242,21 +1231,21 @@ used for optimization."
(let* ((line-re (org-x-dag-line-regexp kws)) (let* ((line-re (org-x-dag-line-regexp kws))
(pps (--map (cons it (org-re-property it nil t)) target-props)) (pps (--map (cons it (org-re-property it nil t)) target-props))
(id-prop (org-re-property "ID" nil t)) (id-prop (org-re-property "ID" nil t))
(first-hl (unless (= ?* (following-char)) (next-pos (unless (= ?* (following-char))
(org-x-dag-next-headline))) (org-x-dag-next-headline)))
;; If not on a headline, check for a property drawer with links in it ;; If not on a headline, check for a property drawer with links in it
(this-file-links (when first-hl (this-file-links (when next-pos
(org-x-dag-get-parent-links nil first-hl))) (org-x-dag-get-parent-links nil next-pos)))
;; stack vars ;; stack vars
bare-stack node-stack bury-level bare-stack node-stack bury-level
;; data vars ;; data vars
this-id this-level this-todo this-tags this-links this-pblock this-id this-level this-todo this-tags this-links this-pblock
this-parent this-buffer-parent this-parent this-buffer-parent this-point this-title this-node
pbeg pend pbeg pend
;; return ;; return
acc acc-links) acc acc-links)
(when first-hl (when next-pos
(goto-char first-hl)) (goto-char next-pos))
(while (looking-at line-re) (while (looking-at line-re)
;; Keep track of how 'deep' we are in a given org-tree using a stack. The ;; Keep track of how 'deep' we are in a given org-tree using a stack. The
;; stack will have members like (LEVEL KEY TAGS) where LEVEL is the level ;; stack will have members like (LEVEL KEY TAGS) where LEVEL is the level
@ -1376,7 +1365,7 @@ used for optimization."
(-let (((x . xs) ,bss)) (-let (((x . xs) ,bss))
;; (if (org-x-dag-bs-is-left-p x) (progn (print x) ',err) ;; (if (org-x-dag-bs-is-left-p x) (progn (print x) ',err)
(if (either-is-left-p x) ',err (if (either-is-left-p x) ',err
(let ((acc (cadr x)) r final) (let ((acc (cadr x)) r final it)
(while (and (not final) xs) (while (and (not final) xs)
(setq x (car xs)) (setq x (car xs))
(if (either-is-left-p x) (if (either-is-left-p x)
@ -2731,6 +2720,17 @@ except it ignores inactive timestamps."
,form) ,form)
,ids)) ,ids))
(defun org-x-dag-rank-leaf-goals (quarter ids)
(cl-flet
((score
(buckets id)
;; TODO what happens when I don't have a bucket?
(let ((idx (-elem-index (org-x-dag-id->bucket t id) (reverse buckets)))
(ntasks (org-x-dag-goal-count-tasks id)))
(list idx ntasks))))
(let ((bs (org-x-qtp-get-buckets quarter)))
(org-x-dag-ids-rank (score bs it) ids))))
;; reductions ;; reductions
;; TODO this is a naive approach that will effectively expand the dag into ;; TODO this is a naive approach that will effectively expand the dag into
@ -3697,6 +3697,15 @@ except it ignores inactive timestamps."
(s `((org-agenda-overriding-header ,n) ,@settings))) (s `((org-agenda-overriding-header ,n) ,@settings)))
(org-x-dag-agenda-run-series buffer-name files `((,type ,match ,s))))) (org-x-dag-agenda-run-series buffer-name files `((,type ,match ,s)))))
(defun org-x-dag-org-mapper-title (level1 level2 status subtitle)
"Make an auto-mapper title.
The title will have the form 'LEVEL1.LEVEL2 STATUS (SUBTITLE)'."
(let ((status* (->> (symbol-name status)
(s-chop-prefix ":")
(s-replace "-" " ")
(s-titleize))))
(format "%s.%s %s (%s)" level1 level2 status* subtitle)))
;; TODO the tags in the far column are redundant ;; TODO the tags in the far column are redundant
(defun org-x-dag-agenda-quarterly-plan () (defun org-x-dag-agenda-quarterly-plan ()
(interactive) (interactive)
@ -3740,7 +3749,7 @@ except it ignores inactive timestamps."
(interactive) (interactive)
(let ((match ''org-x-dag-scan-tasks-with-goals) (let ((match ''org-x-dag-scan-tasks-with-goals)
(files (org-x-get-action-files))) (files (org-x-get-action-files)))
(nd/org-agenda-call "Tasks by Goal" nil #'org-x-dag-show-nodes match files (org-x-dag-agenda-call "Tasks by Goal" nil #'org-x-dag-show-nodes match files
`((org-agenda-todo-ignore-with-date t) `((org-agenda-todo-ignore-with-date t)
(org-agenda-sorting-strategy '(user-defined-up category-keep)) (org-agenda-sorting-strategy '(user-defined-up category-keep))
(org-super-agenda-groups (org-super-agenda-groups
@ -3755,7 +3764,7 @@ except it ignores inactive timestamps."
(interactive) (interactive)
(let ((match ''org-x-dag-scan-survival-tasks) (let ((match ''org-x-dag-scan-survival-tasks)
(files (org-x-get-action-files))) (files (org-x-get-action-files)))
(nd/org-agenda-call "Survival Tasks" nil #'org-x-dag-show-nodes match files (org-x-dag-agenda-call "Survival Tasks" nil #'org-x-dag-show-nodes match files
`((org-agenda-todo-ignore-with-date t) `((org-agenda-todo-ignore-with-date t)
(org-agenda-sorting-strategy '(user-defined-up category-keep)) (org-agenda-sorting-strategy '(user-defined-up category-keep))
(org-super-agenda-groups (org-super-agenda-groups
@ -3772,7 +3781,7 @@ except it ignores inactive timestamps."
(interactive) (interactive)
(let ((match ''org-x-dag-scan-projects-with-goals) (let ((match ''org-x-dag-scan-projects-with-goals)
(files (org-x-get-action-files))) (files (org-x-get-action-files)))
(nd/org-agenda-call "Projects by Goal" nil #'org-x-dag-show-nodes match files (org-x-dag-agenda-call "Projects by Goal" nil #'org-x-dag-show-nodes match files
`((org-agenda-todo-ignore-with-date t) `((org-agenda-todo-ignore-with-date t)
(org-agenda-sorting-strategy '(user-defined-up category-keep)) (org-agenda-sorting-strategy '(user-defined-up category-keep))
(org-super-agenda-groups (org-super-agenda-groups
@ -3789,7 +3798,7 @@ except it ignores inactive timestamps."
;; (interactive) ;; (interactive)
;; (let ((match ''org-x-dag-scan-survival-projects) ;; (let ((match ''org-x-dag-scan-survival-projects)
;; (files (org-x-get-action-files))) ;; (files (org-x-get-action-files)))
;; (nd/org-agenda-call "Survival Projects" nil #'org-x-dag-show-nodes match files ;; (org-x-dag-agenda-call "Survival Projects" nil #'org-x-dag-show-nodes match files
;; `((org-agenda-todo-ignore-with-date t) ;; `((org-agenda-todo-ignore-with-date t)
;; (org-agenda-sorting-strategy '(user-defined-up category-keep)) ;; (org-agenda-sorting-strategy '(user-defined-up category-keep))
;; (org-super-agenda-groups ;; (org-super-agenda-groups
@ -3803,7 +3812,7 @@ except it ignores inactive timestamps."
(defun org-x-dag-agenda-goals () (defun org-x-dag-agenda-goals ()
(interactive) (interactive)
(let ((match ''org-x-dag-scan-goals)) (let ((match ''org-x-dag-scan-goals))
(nd/org-agenda-call "Goals-0" nil #'org-x-dag-show-nodes match nil (org-x-dag-agenda-call "Goals-0" nil #'org-x-dag-show-nodes match nil
`((org-agenda-sorting-strategy '(user-defined-up category-keep)) `((org-agenda-sorting-strategy '(user-defined-up category-keep))
(org-super-agenda-groups (org-super-agenda-groups
'((:auto-map '((:auto-map
@ -3837,7 +3846,7 @@ except it ignores inactive timestamps."
(defun org-x-dag-agenda-incubated () (defun org-x-dag-agenda-incubated ()
(interactive) (interactive)
(let ((match ''org-x-dag-scan-incubated)) (let ((match ''org-x-dag-scan-incubated))
(nd/org-agenda-call "Incubated-0" nil #'org-x-dag-show-nodes match nil (org-x-dag-agenda-call "Incubated-0" nil #'org-x-dag-show-nodes match nil
`((org-agenda-sorting-strategy '(user-defined-up category-keep)) `((org-agenda-sorting-strategy '(user-defined-up category-keep))
(org-super-agenda-groups (org-super-agenda-groups
'((:auto-map '((:auto-map
@ -3893,7 +3902,7 @@ In the order of display
(defun org-x-dag-agenda-goals-0 () (defun org-x-dag-agenda-goals-0 ()
(interactive) (interactive)
(let ((match ''org-x-dag-scan-goals)) (let ((match ''org-x-dag-scan-goals))
(nd/org-agenda-call "Goals-0" nil #'org-x-dag-show-nodes match nil (org-x-dag-agenda-call "Goals-0" nil #'org-x-dag-show-nodes match nil
`((org-agenda-todo-ignore-with-date t) `((org-agenda-todo-ignore-with-date t)
(org-agenda-sorting-strategy '(user-defined-up category-keep)) (org-agenda-sorting-strategy '(user-defined-up category-keep))
(org-super-agenda-groups (org-super-agenda-groups
@ -3919,7 +3928,7 @@ review phase)"
(interactive) (interactive)
(let ((match ''org-x-dag-scan-tasks) (let ((match ''org-x-dag-scan-tasks)
(files (org-x-get-action-files))) (files (org-x-get-action-files)))
(nd/org-agenda-call "Tasks-0" nil #'org-x-dag-show-nodes match files (org-x-dag-agenda-call "Tasks-0" nil #'org-x-dag-show-nodes match files
`((org-agenda-skip-function #'org-x-task-skip-function) `((org-agenda-skip-function #'org-x-task-skip-function)
(org-agenda-todo-ignore-with-date t) (org-agenda-todo-ignore-with-date t)
(org-agenda-sorting-strategy '(user-defined-up category-keep)) (org-agenda-sorting-strategy '(user-defined-up category-keep))
@ -3931,14 +3940,14 @@ review phase)"
(s* (if (and (not i) (eq s :inert)) :active s)) (s* (if (and (not i) (eq s :inert)) :active s))
((level1 subtitle) (if i '(1 "α") '(0 "σ"))) ((level1 subtitle) (if i '(1 "α") '(0 "σ")))
(p (alist-get s* nd/org-headline-task-status-priorities))) (p (alist-get s* nd/org-headline-task-status-priorities)))
(nd/org-mapper-title level1 p s* subtitle)))))))))) (org-x-dag-org-mapper-title level1 p s* subtitle))))))))))
(defun org-x-dag-agenda-projects-0 () (defun org-x-dag-agenda-projects-0 ()
"Show the projects agenda view." "Show the projects agenda view."
(interactive) (interactive)
(let ((match ''org-x-dag-scan-projects) (let ((match ''org-x-dag-scan-projects)
(files (org-x-get-action-and-incubator-files))) (files (org-x-get-action-and-incubator-files)))
(nd/org-agenda-call "Projects-0" nil #'org-x-dag-show-nodes match files (org-x-dag-agenda-call "Projects-0" nil #'org-x-dag-show-nodes match files
`((org-agenda-sorting-strategy '(category-keep)) `((org-agenda-sorting-strategy '(category-keep))
(org-super-agenda-groups (org-super-agenda-groups
'((:auto-map '((:auto-map
@ -3947,13 +3956,13 @@ review phase)"
(s (get-text-property 1 'x-status line)) (s (get-text-property 1 'x-status line))
(p (get-text-property 1 'x-priority line)) (p (get-text-property 1 'x-priority line))
((level1 subtitle) (if i '(0 "τ") '(1 "σ")))) ((level1 subtitle) (if i '(0 "τ") '(1 "σ"))))
(nd/org-mapper-title level1 p s subtitle)))))))))) (org-x-dag-org-mapper-title level1 p s subtitle))))))))))
(defun org-x-dag-agenda-incubator-0 () (defun org-x-dag-agenda-incubator-0 ()
"Show the incubator agenda view." "Show the incubator agenda view."
(interactive) (interactive)
(let ((match ''org-x-dag-scan-incubated)) (let ((match ''org-x-dag-scan-incubated))
(nd/org-agenda-call "Incubator-0" nil #'org-x-dag-show-nodes match nil (org-x-dag-agenda-call "Incubator-0" nil #'org-x-dag-show-nodes match nil
`((org-agenda-sorting-strategy '(category-keep)) `((org-agenda-sorting-strategy '(category-keep))
(org-super-agenda-groups (org-super-agenda-groups
'((:auto-map '((:auto-map
@ -3974,7 +3983,7 @@ review phase)"
(interactive) (interactive)
(let ((files (org-x-get-action-files)) (let ((files (org-x-get-action-files))
(match ''org-x-dag-scan-iterators)) (match ''org-x-dag-scan-iterators))
(nd/org-agenda-call "Iterators-0" nil #'org-x-dag-show-nodes match files (org-x-dag-agenda-call "Iterators-0" nil #'org-x-dag-show-nodes match files
`((org-agenda-sorting-strategy '(category-keep)) `((org-agenda-sorting-strategy '(category-keep))
(org-super-agenda-groups (org-super-agenda-groups
',(nd/org-def-super-agenda-automap ',(nd/org-def-super-agenda-automap
@ -3990,7 +3999,7 @@ review phase)"
"Show the critical errors agenda view." "Show the critical errors agenda view."
(interactive) (interactive)
(let ((match ''org-x-dag-scan-errors)) (let ((match ''org-x-dag-scan-errors))
(nd/org-agenda-call "Errors-0" nil #'org-x-dag-show-nodes match nil (org-x-dag-agenda-call "Errors-0" nil #'org-x-dag-show-nodes match nil
`((org-super-agenda-groups `((org-super-agenda-groups
'((:auto-map '((:auto-map
(lambda (line) (lambda (line)
@ -4001,8 +4010,8 @@ review phase)"
(interactive) (interactive)
(let ((files (org-x-get-action-files)) (let ((files (org-x-get-action-files))
(match ''org-x-dag-scan-archived)) (match ''org-x-dag-scan-archived))
(nd/org-agenda-call "Archive-0" nil #'org-x-dag-show-nodes match files (org-x-dag-agenda-call "Archive-0" nil #'org-x-dag-show-nodes match files
;; (nd/org-agenda-call-headlines "Archive-0" nil (org-x-get-action-files) ;; (org-x-dag-agenda-call-headlines "Archive-0" nil (org-x-get-action-files)
`((org-agenda-sorting-strategy '(category-keep)) `((org-agenda-sorting-strategy '(category-keep))
(org-super-agenda-groups (org-super-agenda-groups
'((:auto-map '((:auto-map