summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2024-03-13 15:01:54 +0800
committerSean Whitton <spwhitton@spwhitton.name>2024-03-13 16:13:35 +0800
commit11d533ead8092e0d060770992064119a1c8aa05f (patch)
tree439fbf25de46b5df8a93bb9efe53c3f0d7f62910
parent96af416dfa06181e7340a5adf98cce5f320c235d (diff)
downloaddotfiles-11d533ead8092e0d060770992064119a1c8aa05f.tar.gz
attempt to replace three Org agenda skip subroutines
-rw-r--r--.emacs.d/init.el35
1 files changed, 6 insertions, 29 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 6dc25e3e..a6e3eb72 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -5256,7 +5256,7 @@ different occasions."
;; we used to skip deadlined standalone tasks but actually those
;; are actionable in general
;; (and (spw/is-task-p)
- ;; (spw/org-has-deadline-p))
+ ;; (org-agenda-skip-entry-if 'deadline))
;; #4--#7
(and (spw/is-subproject-p)
@@ -5272,37 +5272,14 @@ different occasions."
;; # 6
(string= (nth 2 (org-heading-components)) "WAITING")
;; # 7
- (spw/org-is-scheduled-p)))))))))
-
-;; We look only right after the headline for SCHEDULED: and DEADLINE:, whereas
-;; `org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item' searches
-;; until the next headline. This should be okay because I only ever put those
-;; on the line right after the headline.
-(cl-macrolet ((task-with-first-line-such-that (&body forms)
- `(and (spw/is-task-or-project-p)
- (save-excursion (beginning-of-line-text 2) ,@forms))))
- (defun spw/org-is-scheduled-p ()
- "A task that is scheduled."
- (task-with-first-line-such-that
- (when (looking-at (org-re-timestamp 'deadline))
- (goto-char (match-end 0)) (skip-syntax-forward "\\s-"))
- (looking-at (org-re-timestamp 'scheduled))))
-
- (defun spw/org-has-deadline-p ()
- "A task that has a deadline."
- (task-with-first-line-such-that
- (when (looking-at (org-re-timestamp 'scheduled))
- (goto-char (match-end 0)) (skip-syntax-forward "\\s-"))
- (looking-at (org-re-timestamp 'deadline))))
-
- (defun spw/org-is-scheduled-or-deadlined-p ()
- "A task that is scheduled or has a deadline."
- (task-with-first-line-such-that
- (looking-at (org-re-timestamp 'scheduled-or-deadline)))))
+ (org-agenda-skip-entry-if 'scheduled)))))))))
(defun spw/has-scheduled-or-deadlined-subproject-p ()
"A task that has a scheduled or deadlined subproject"
- (spw/has-subheading-such-that (spw/org-is-scheduled-or-deadlined-p)))
+ (and (not (org-before-first-heading-p))
+ (spw/has-subheading-such-that
+ (and (spw/is-task-or-project-p)
+ (org-agenda-skip-entry-if 'scheduled 'deadline)))))
(defun spw/has-next-action-p ()
"A task that has a NEXT subproject"