From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Detect parent with SCHEDULED or DEADLINE Date: Thu, 14 Apr 2016 09:57:50 +0200 Message-ID: <87mvowzkox.fsf@nicolasgoaziou.fr> References: <87bn5dupt4.fsf@artlab.createcnix.lan> <87vb3kx1r6.fsf@alphapapa.net> <87r3e8zmrf.fsf@nicolasgoaziou.fr> <87h9f48xfz.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqc7u-0007LF-Az for emacs-orgmode@gnu.org; Thu, 14 Apr 2016 03:55:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqc7p-0000eR-Bf for emacs-orgmode@gnu.org; Thu, 14 Apr 2016 03:55:46 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:47986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqc7p-0000eN-0C for emacs-orgmode@gnu.org; Thu, 14 Apr 2016 03:55:41 -0400 In-Reply-To: <87h9f48xfz.fsf@alphapapa.net> (Adam Porter's message of "Thu, 14 Apr 2016 02:24:32 -0500") 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: Adam Porter Cc: emacs-orgmode@gnu.org Adam Porter writes: > Ah, I see. So I guess the solution to Christophe's issue is to use > this: > > #+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 (org-entry-get "SCHEDULED" t)) > (inherited-deadline (org-entry-get "DEADLINE" t))) > ;; I will consider the scheduled part if I can make it work with > ;; deadlines first > (if (org-not-nil inherited-deadline) > next-headline > nil))) > #+END_SRC I don't think so. You cannot force inheritance for a special property, which obey to its own rules. The optional argument is going to be ignored. If the OP wants to get the SCHEDULED value of the current headline or any of its parent, he can move up the hierarchy with `org-up-heading-safe', calling `org-entry-get' at each stop. Regards,