Christophe Schockaert writes:

> Nicolas Goaziou writes:
>
>> Adam Porter <a...@alphapapa.net> 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:r3vli...@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] <---------------<<<<

Reply via email to