emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do not show a TODO item in the global TODO list until certain date?


From: Ihor Radchenko
Subject: Re: Do not show a TODO item in the global TODO list until certain date?
Date: Wed, 12 Oct 2022 19:26:56 +0800

Angel de Vicente <angel.vicente.garrido@gmail.com> writes:

> I copied your code from
> https://github.com/yantar92/emacs-config/blob/master/config.org#properties
> into my .emacs and eval-ed it.
> ...
> But the "test" still shows in the TODO list. Am I missing something
> basic here?

Not really. I just use a different system for skip functions.

Try the following adjusted version:

(defun org-agenda-skip-before-SHOWFROMDATE-property ()
  "Skip agenda item if :SHOWFROMDATE: property is set and the day is before it"
  (when-let* ((showfromdate (if (bound-and-true-p org-ql--current-element)
                                (org-element-property :SHOWFROMDATE 
(org-element-lineage org-ql--current-element '(headline) t))
                              (org-entry-get (point) "SHOWFROMDATE")))
              (showfromdate (unless (seq-empty-p showfromdate) (ts-parse-org 
showfromdate)))
              (currenttime (ts-now)))
    (when (ts< currenttime showfromdate)
      (or (outline-next-heading) (point-max)))))

(Note that the code requires ts library installed).

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]