From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christophe Schockaert Subject: Re: Detect parent with SCHEDULED or DEADLINE Date: Thu, 14 Apr 2016 23:49:20 +0200 Message-ID: <87twj3c13z.fsf@artlab.createcnix.lan> References: <87bn5dupt4.fsf@artlab.createcnix.lan> <87vb3kx1r6.fsf@alphapapa.net> <87r3e8zmrf.fsf@nicolasgoaziou.fr> <87h9f48xfz.fsf@alphapapa.net> <87mvowzkox.fsf@nicolasgoaziou.fr> <87vb3jc22c.fsf@artlab.createcnix.lan> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqp9H-0000VM-0Y for emacs-orgmode@gnu.org; Thu, 14 Apr 2016 17:50:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqp9C-0005Ks-13 for emacs-orgmode@gnu.org; Thu, 14 Apr 2016 17:50:02 -0400 Received: from smtp2.tech.numericable.fr ([82.216.111.38]:46571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqp9B-0005Kn-QZ for emacs-orgmode@gnu.org; Thu, 14 Apr 2016 17:49:57 -0400 In-reply-to: <87vb3jc22c.fsf@artlab.createcnix.lan> 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" To: Nicolas Goaziou Cc: Adam Porter , emacs-orgmode@gnu.org Christophe Schockaert writes: > Nicolas Goaziou writes: > >> Adam Porter writes: [...] > Thank you Adam and Nicolas for your answers, > [...] > I could rewrite my function using 'org-up-heading-safe' and > 'org-entry-get', and it gets the expected result in the agenda view :-) Sorry for multiple posting, I thought afterwards I could share the solution I came with: #+BEGIN_SRC elisp (defun r3v/skip-inherited-scheduled-or-deadline () "Skip tasks that inherit from SCHEDULED or DEADLINE" (let ((next-headline (save-excursion (or (outline-next-heading) (point-max)))) (inherited-scheduled) (inherited-deadline)) (save-excursion (save-restriction (widen) (while (and (not inherited-scheduled) (not inherited-deadline) (org-up-heading-safe)) (setq inherited-scheduled (org-entry-get (point) "SCHEDULED")) (setq inherited-deadline (org-entry-get (point) "DEADLINE")) ) (if (or (org-not-nil inherited-scheduled) (org-not-nil inherited-deadline)) next-headline nil))))) #+END_SRC Christophe -- ---------------> mailto:R3vLibre@citadels.eu Once it's perfectly aimed, the flying arrow goes straight to its target. Thus, don't worry when things go right. There will be enough time to worry about if they go wrong. Then, it's time to fire a new arrow towards another direction. Don't sink. Adapt yourself ! The archer has to shoot accurately and quickly. [Words of Erenthar, the bowman ranger] <---------------<<<<