In elisp, how can I tell whether the org heading under point is a leaf node or whether it has child headings? I've found org-list-has-child-p
, but I'm having trouble delivering the struct to the function.
You could try org-goto-first-child
(inside save-excursion
, so you don't actually move the point) and see if it returned nil
:
(defun my-org-has-child-p ()
(interactive)
(save-excursion
(org-goto-first-child)))
outline-level
function may be of use:(< (funcall outline-level) (save-excursion (outline-next-heading) (funcall outline-level)))
. – mutbuerger Apr 29 '15 at 19:23