emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Detect parent with SCHEDULED or DEADLINE


From: Christophe Schockaert
Subject: Re: [O] Detect parent with SCHEDULED or DEADLINE
Date: Thu, 14 Apr 2016 23:49:20 +0200

Christophe Schockaert writes:

> Nicolas Goaziou writes:
>
>> Adam Porter <address@hidden> 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:address@hidden
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] <---------------<<<<



reply via email to

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