summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIhor Radchenko <yantar92@posteo.net>2023-12-11 15:17:41 +0100
committerIhor Radchenko <yantar92@posteo.net>2023-12-12 12:55:11 +0100
commit7505055f58c3a44ed6f1af6269dff83e9e3ade97 (patch)
tree6abbf8390ccb8a6931f4ebac4d4a10327054b57f
parent420ed4e0338d12e26c62d3666ca39e7cff323d05 (diff)
downloadorg-mode-7505055f5.tar.gz
org-agenda-to-appt: Do not hard-code not-done todo keywords
* lisp/org-agenda.el (org-agenda-to-appt): Use org-todo-regexp and org-not-done-regexp to determine whether an even is already done. Reported-by: Raffael Stocker <r.stocker@mnet-mail.de> Link: https://orgmode.org/list/yplmsf4ac6va.fsf@mnet-mail.de
-rw-r--r--lisp/org-agenda.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index ac8adda..6a9b1cc 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -11141,10 +11141,16 @@ to override `appt-message-warning-time'."
(string-match cat-filter cat))
(and (stringp evt-filter)
(string-match evt-filter evt)))))))
- (wrn (get-text-property 1 'warntime x)))
+ (wrn (get-text-property 1 'warntime x))
+ (todo-regexp (get-text-property 1 'org-todo-regexp x))
+ (not-done-regexp (get-text-property 1 'org-not-done-regexp x)))
;; FIXME: Shall we remove text-properties for the appt text?
;; (setq evt (set-text-properties 0 (length evt) nil evt))
- (when (and ok tod (not (string-match "\\`DONE\\|CANCELLED" evt)))
+ (when (and ok tod
+ ;; Exclude done items unconditionally.
+ (or (not (and todo-regexp (string-match-p todo-regexp evt))) ; no todo keyword
+ (and not-done-regexp (string-match-p not-done-regexp evt)) ; or not done
+ ))
(setq tod (concat "00" (number-to-string tod)))
(setq tod (when (string-match
"\\([0-9]\\{1,2\\}\\)\\([0-9]\\{2\\}\\)\\'" tod)