[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Agenda view: do not display tasks of projects scheduled in the f
From: |
Alan Schmitt |
Subject: |
Re: [O] Agenda view: do not display tasks of projects scheduled in the future |
Date: |
Sun, 05 Jan 2014 11:32:46 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) |
Hi Bastien,
Bastien <address@hidden> writes:
> Hi Alan,
>
> Alan Schmitt <address@hidden> writes:
>
>> #+BEGIN_SRC emacs-lisp
>> (defun as/skip-future-tasks ()
>> "Skip future tasks"
>> (save-restriction
>> (widen)
>> (let ((subtree-end (save-excursion (org-end-of-subtree t))))
>> (cond
>> ((org-entry-scheduded-in-future-p)
>> subtree-end)
>> (t
>> nil)))))
>> #+END_SRC
>>
>> Any suggestion as how I might write such a predicate?
>
> Coming late so maybe it's not useful anymore, but here is a stab:
>
> (defun org-entry-scheduded-in-future-p ()
> (interactive)
> (let ((sc (org-get-scheduled-time (point)))
> ;; (dl (org-get-deadline-time (point)))
> ;; (ts (org-time-string-to-time (org-entry-get (point) "TIMESTAMP")))
> (ct (current-time)))
> (time-less-p ct sc)))
This was most helpful, thank you. This is what I finally came up with (I
just added a check that there was a scheduled time):
(defun org-entry-scheduled-in-future-p ()
(interactive)
(let ((sc (org-get-scheduled-time (point)))
;; (dl (org-get-deadline-time (point)))
;; (ts (org-time-string-to-time (org-entry-get (point) "TIMESTAMP")))
(ct (current-time)))
(and sc (time-less-p ct sc))))
By the way, is there a place where the functions such as
"org-get-scheduled-time" are documented? Or does one have to look at the
source?
Thanks again,
Alan