1

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.

  • the 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
3

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)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.