branch: externals/org
commit 693a3c558f92c8c42ab9ac9ef8fb4501ae88b7d4
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    org-icalendar-entry: Fix when the value is a list of keywords
    
    * lisp/ox-icalendar.el (org-icalendar-entry): Add condition when the
    value of :icalendar-include-todo is a list of keywords.
    (org-icalendar-include-todo): Document that the value can be a list of
    keywords, as per :type spec.
    
    Reported-by: Björn Bidar <bjorn.bi...@thaodan.de>
    Link: https://list.orgmode.org/orgmode/87ttqjirrv.fsf@/
---
 lisp/ox-icalendar.el | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el
index 20efad243a..be9ac31694 100644
--- a/lisp/ox-icalendar.el
+++ b/lisp/ox-icalendar.el
@@ -222,7 +222,8 @@ Valid values are:
 nil                  don't include any task.
 t                    include tasks that are not in DONE state.
 `unblocked'          include all TODO items that are not blocked.
-`all'                include both done and not done items."
+`all'                include both done and not done items.
+\\(\"TODO\" ...)       include specific TODO keywords."
   :group 'org-export-icalendar
   :type '(choice
          (const :tag "None" nil)
@@ -727,13 +728,16 @@ inlinetask within the section."
          ;; so, call `org-icalendar--vtodo' to transcode it into
          ;; a "VTODO" component.
          (when (and todo-type
-                    (cl-case (plist-get info :icalendar-include-todo)
-                      (all t)
-                      (unblocked
+                    (pcase (plist-get info :icalendar-include-todo)
+                      (`all t)
+                      (`unblocked
                        (and (eq type 'headline)
                             (not (org-icalendar-blocked-headline-p
-                                  entry info))))
-                      ((t) (eq todo-type 'todo))))
+                                entry info))))
+                       ;; unfinished
+                      (`t (eq todo-type 'todo))
+                       ((and (pred listp) kwd-list)
+                        (member (org-element-property :todo-keyword entry) 
kwd-list))))
            (org-icalendar--vtodo entry uid summary loc desc cat tz class))
          ;; Diary-sexp: Collect every diary-sexp element within ENTRY
          ;; and its title, and transcode them.  If ENTRY is

Reply via email to