mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-02-16 16:24:18 +00:00
New views, deleted old functions, converted from legacy
This commit is contained in:
parent
a52f3bd116
commit
e1dcbbdba7
3 changed files with 40 additions and 122 deletions
|
|
@ -617,6 +617,10 @@
|
|||
(when seen-non-todo
|
||||
(throw 'break t)))))))))
|
||||
|
||||
(defun my/ambiguous-todo ()
|
||||
(and (opr/type-of-project)
|
||||
(opr/type-of-task))))
|
||||
|
||||
(let* ((prod-tag "+time")
|
||||
(dev-tag "+dev")
|
||||
(sandbox-tag "+sandbox"))
|
||||
|
|
@ -736,17 +740,18 @@
|
|||
(member (expand-file-name x) my/non-agenda-files))
|
||||
my/all-agenda-files))))))
|
||||
("ma" "Archive trees"
|
||||
((tags "ARCHIVE"
|
||||
((org-agenda-overriding-header "Big archive trees")
|
||||
(org-tags-match-list-sublevels nil)
|
||||
(org-agenda-skip-archived-trees nil)
|
||||
(org-agenda-skip-function 'my/show-big-top-levels)))
|
||||
(tags "ARCHIVE"
|
||||
((org-agenda-overriding-header "Small archive trees")
|
||||
(org-tags-match-list-sublevels nil)
|
||||
(org-agenda-skip-archived-trees nil)
|
||||
(org-agenda-skip-function 'my/show-small-top-levels))))
|
||||
((my/delete-blocks nil)))
|
||||
((org-ql-block '(and (tags "ARCHIVE")
|
||||
(my/top-level)
|
||||
(let ((size (- (save-excursion (org-end-of-subtree t t)) (point))))
|
||||
(>= size 50000)))
|
||||
((org-ql-block-header "Big archive trees")))
|
||||
(org-ql-block '(and (tags "ARCHIVE")
|
||||
(my/top-level)
|
||||
(let ((size (- (save-excursion (org-end-of-subtree t t)) (point))))
|
||||
(< size 50000)))
|
||||
((org-ql-block-header "Small archive trees"))))
|
||||
((my/delete-blocks nil)
|
||||
(org-use-tag-inheritance nil)))
|
||||
("mr" "Recategorize dev to sandbox" todo (mapconcat #'identity org-done-keywords-for-agenda "|")
|
||||
((org-agenda-skip-function 'my/show-top-level)
|
||||
(org-agenda-files '(,(my/agenda-file "dev.org")))))
|
||||
|
|
@ -763,6 +768,10 @@
|
|||
(todo "TODO" "META" "META1" "EMPTY" "ONE")
|
||||
(not (my/valid-todo)))
|
||||
((org-ql-block-header "sandbox")))))
|
||||
("mA" "Ambiguous todos"
|
||||
((org-ql-block '(and (todo)
|
||||
(my/ambiguous-todo))
|
||||
((org-ql-block-header "sandbox")))))
|
||||
("f" . "Flip through")
|
||||
("fc" "Comms" tags-todo "datetime"
|
||||
((org-agenda-overriding-header "Comms")))
|
||||
|
|
|
|||
|
|
@ -61,23 +61,27 @@
|
|||
("COMPLETE" 'done)
|
||||
("HALT" 'stuck)
|
||||
("WAIT" 'active)
|
||||
(_ (if (member "_invis_" (org-get-tags))
|
||||
'invis
|
||||
(pcase state
|
||||
("TASK" (if (or (org-get-deadline-time (point))
|
||||
(org-get-scheduled-time (point)))
|
||||
'active
|
||||
'stuck))
|
||||
("ONE" (when (eq 'task (opr/ambiguous-task-or-project))
|
||||
(if (or (org-get-deadline-time (point))
|
||||
(org-get-scheduled-time (point)))
|
||||
'active
|
||||
'stuck)))
|
||||
("TODO" (when (eq 'task (opr/ambiguous-task-or-project))
|
||||
(if (or (org-get-deadline-time (point))
|
||||
(_ (when (or (member state opr/strict-tasks)
|
||||
(and (member state opr/ambiguous)
|
||||
(eq 'task
|
||||
(opr/ambiguous-task-or-project))))
|
||||
(if (member "_invis_" (org-get-tags))
|
||||
'invis
|
||||
(pcase state
|
||||
("TASK" (if (or (org-get-deadline-time (point))
|
||||
(org-get-scheduled-time (point)))
|
||||
'active
|
||||
'stuck)))))))))
|
||||
'stuck))
|
||||
("ONE" (when (eq 'task (opr/ambiguous-task-or-project))
|
||||
(if (or (org-get-deadline-time (point))
|
||||
(org-get-scheduled-time (point)))
|
||||
'active
|
||||
'stuck)))
|
||||
("TODO" (when (eq 'task (opr/ambiguous-task-or-project))
|
||||
(if (or (org-get-deadline-time (point))
|
||||
(org-get-scheduled-time (point)))
|
||||
'active
|
||||
'stuck))))))))))
|
||||
|
||||
(provide 'opr-tasks)
|
||||
;;; opr-tasks.el ends here
|
||||
|
|
|
|||
|
|
@ -60,12 +60,6 @@
|
|||
;; (todo ("HOLD") ("WAITING")))))
|
||||
|
||||
;; New stuff
|
||||
(defconst not-tasks-tag "NOT_TASKS")
|
||||
(defconst these-are-not-tasks '("TTTT" "INACT" "CLOCK" "FUTURE" "DEPEND" "CAT"))
|
||||
|
||||
(defun my/is-non-task ()
|
||||
(member (org-get-todo-state) these-are-not-tasks))
|
||||
|
||||
(defun my/is-todo-task ()
|
||||
(and (not (member "_invis_" (org-get-tags)))
|
||||
(pcase (org-get-todo-state)
|
||||
|
|
@ -277,6 +271,7 @@
|
|||
(when (my/has-todo-child)
|
||||
(if (my/greedy-active-project (buffer-file-name) (point))
|
||||
'active 'stuck)))))))))
|
||||
|
||||
(defun my/show-active-projects ()
|
||||
"Only show subtrees that are stuck projects"
|
||||
(save-restriction
|
||||
|
|
@ -286,20 +281,6 @@
|
|||
'(active))
|
||||
subtree-end))))
|
||||
|
||||
(defun my/dev-show-active-projects ()
|
||||
"Only show subtrees that are stuck projects"
|
||||
(save-restriction
|
||||
(widen)
|
||||
(let ((subtree-end (save-excursion (org-end-of-subtree t))))
|
||||
(unless (or (and (my/is-todo-task)
|
||||
(my/is-standalone-task)
|
||||
(or (string= (org-get-todo-state) "NEXT")
|
||||
(org-get-scheduled-time (point))
|
||||
(org-get-deadline-time (point))))
|
||||
(member (my/get-project-type buffer-file-name (point) nil)
|
||||
'(active)))
|
||||
subtree-end))))
|
||||
|
||||
(defun my/show-stuck-projects ()
|
||||
"Only show subtrees that are stuck projects"
|
||||
(save-restriction
|
||||
|
|
@ -318,22 +299,6 @@
|
|||
subtree-end)
|
||||
next-heading))))
|
||||
|
||||
(defun my/dev-show-stuck-projects ()
|
||||
"Only show subtrees that are stuck projects"
|
||||
(save-restriction
|
||||
(widen)
|
||||
(let ((subtree-end (save-excursion (org-end-of-subtree t t)))
|
||||
(next-heading (save-excursion (outline-next-heading))))
|
||||
(if (org-get-todo-state)
|
||||
(unless (or (and (my/is-a-task)
|
||||
(my/is-standalone-task)
|
||||
(not (org-get-scheduled-time (point)))
|
||||
(not (org-get-deadline-time (point))))
|
||||
(eq (my/get-project-type buffer-file-name (point) t)
|
||||
'stuck))
|
||||
subtree-end)
|
||||
next-heading))))
|
||||
|
||||
(defun my/show-delayed-projects ()
|
||||
(save-restriction
|
||||
(widen)
|
||||
|
|
@ -379,37 +344,6 @@
|
|||
(my/has-next-todo))
|
||||
next-headline)))
|
||||
|
||||
(defun my/skip-standalone-tasks ()
|
||||
(when (my/is-standalone-task)
|
||||
(org-end-of-subtree t t)))
|
||||
|
||||
|
||||
;; (defvar my/done-projects-flag nil)
|
||||
|
||||
;; (defun my/show-done-projects-and-tasks ()
|
||||
;; "Show top level leaf of these todos: DONE|CANCELLED|COMPLETE"
|
||||
;; (save-restriction
|
||||
;; (widen)
|
||||
;; (let ((subtree-end (save-excursion (org-end-of-subtree t)))
|
||||
;; (next-headline (save-excursion (or (outline-next-heading) (point-max)))))
|
||||
;; (if my/done-projects-flag
|
||||
;; (let ((ov my/done-projects-flag))
|
||||
;; (setq my/done-projects-flag nil)
|
||||
;; ov)
|
||||
;; (if (member (org-get-todo-state) org-done-keywords)
|
||||
;; (progn (setq my/done-projects-flag subtree-end)
|
||||
;; nil)
|
||||
;; next-headline)))))
|
||||
|
||||
(defun my/show-done-projects-and-tasks ()
|
||||
"Show top level leaf of these todos: DONE|CANCELLED|COMPLETE"
|
||||
(save-restriction
|
||||
(widen)
|
||||
(let ((next-headline (save-excursion (or (outline-next-heading) (point-max)))))
|
||||
(unless (and (member (org-get-todo-state) org-done-keywords)
|
||||
(not (my/is-part-of-subtree)))
|
||||
next-headline))))
|
||||
|
||||
(defun my/parent-is-eternal ()
|
||||
(save-excursion
|
||||
(and (not (= 1 (org-current-level)))
|
||||
|
|
@ -425,34 +359,5 @@
|
|||
(my/parent-is-eternal))
|
||||
next-headline))))
|
||||
|
||||
(defun my/show-big-top-levels ()
|
||||
(save-restriction
|
||||
(widen)
|
||||
(let ((next-headline (save-excursion (or (outline-next-heading) (point-max))))
|
||||
(size (- (save-excursion (org-end-of-subtree t t)) (point))))
|
||||
(unless (and
|
||||
(or (not (my/is-part-of-subtree))
|
||||
(my/parent-is-eternal))
|
||||
(> size 50000))
|
||||
next-headline))))
|
||||
|
||||
(defun my/show-small-top-levels ()
|
||||
(save-restriction
|
||||
(widen)
|
||||
(let ((next-headline (save-excursion (or (outline-next-heading) (point-max))))
|
||||
(size (- (save-excursion (org-end-of-subtree t t)) (point))))
|
||||
(unless (and
|
||||
(or (not (my/is-part-of-subtree))
|
||||
(my/parent-is-eternal))
|
||||
(< size 50000))
|
||||
next-headline))))
|
||||
|
||||
(defun my/skip-if-top-level-dev ()
|
||||
(let ((bname (file-name-nondirectory (buffer-file-name))))
|
||||
(when (and (string= bname "dev.org")
|
||||
(not (my/is-part-of-subtree)))
|
||||
(save-excursion
|
||||
(outline-next-heading)))))
|
||||
|
||||
(provide 'org-project-legacy)
|
||||
;;; org-project-legacy.el ends here
|
||||
|
|
|
|||
Loading…
Reference in a new issue