summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Parri <simonparri@ganzeria.com>2025-06-23 18:14:37 -0500
committerSimon Parri <simonparri@ganzeria.com>2025-06-23 18:14:37 -0500
commit63702534b5f30a6e1285d3c564641072a239af9e (patch)
tree5560cbcb957b9997e7568514137afe956f5c13ea
parent0e0cc8b6e7047f178702cfda5a367f0fc449d885 (diff)
downloadorg-urgency-63702534b5f30a6e1285d3c564641072a239af9e.tar.gz
org-urgency-63702534b5f30a6e1285d3c564641072a239af9e.zip
Implement `org-urgency-by-timestamped-today?'
-rw-r--r--org-urgency.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/org-urgency.el b/org-urgency.el
index 3ac79f7..68c0bf0 100644
--- a/org-urgency.el
+++ b/org-urgency.el
@@ -173,6 +173,18 @@ When N is 1, the urgency from this function is equal to
(coeff (- maximum remaining)))
(* n coeff)))
+(org-urgency-define timestamped-today? ()
+ "Urgency N when H somehow appears today."
+ (when-let* ((stamp (thread-first
+ (get 'org-marker)
+ (org-entry-get "TIMESTAMP")))
+ (date (thread-first
+ (org-parse-time-string stamp)
+ (encode-time)
+ (time-to-days)))
+ (today? (= date (org-today))))
+ n))
+
(org-urgency-define tag? (tag)
"Urgency N when H has tag TAG."
(when (member tag (get 'tags))