From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Agenda view: do not display tasks of projects scheduled in the future Date: Sat, 04 Jan 2014 18:36:32 +0100 Message-ID: <8738l3zm1r.fsf@bzg.ath.cx> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzV9O-0007OL-Fi for emacs-orgmode@gnu.org; Sat, 04 Jan 2014 12:36:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzV9I-0002uk-Ox for emacs-orgmode@gnu.org; Sat, 04 Jan 2014 12:36:42 -0500 Received: from mail-we0-x236.google.com ([2a00:1450:400c:c03::236]:62188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzV9I-0002uY-JT for emacs-orgmode@gnu.org; Sat, 04 Jan 2014 12:36:36 -0500 Received: by mail-we0-f182.google.com with SMTP id q59so14704216wes.27 for ; Sat, 04 Jan 2014 09:36:35 -0800 (PST) In-Reply-To: (Alan Schmitt's message of "Wed, 18 Dec 2013 15:26:24 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alan Schmitt Cc: emacs-orgmode Hi Alan, Alan Schmitt 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))) -- Bastien