Function: org-goto-first-child
org-goto-first-child is a byte-compiled function defined in org.el.gz.
Signature
(org-goto-first-child &optional ELEMENT)
Documentation
Goto the first child, even if it is invisible.
Return t when a child was found. Otherwise don't move point and return nil.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-goto-first-child (&optional element)
"Goto the first child, even if it is invisible.
Return t when a child was found. Otherwise don't move point and
return nil."
(if (org-element--cache-active-p)
(let ((heading (org-element-lineage
(or element (org-element-at-point))
'(headline inlinetask org-data)
t)))
(when heading
(unless (or (eq 'inlinetask (org-element-type heading))
(not (org-element-property :contents-begin heading)))
(let ((pos (point)))
(goto-char (org-element-property :contents-begin heading))
(if (re-search-forward
org-outline-regexp-bol
(org-element-property :end heading)
t)
(progn (goto-char (match-beginning 0)) t)
(goto-char pos) nil)))))
(let (level (pos (point)) (re org-outline-regexp-bol))
(when (org-back-to-heading-or-point-min t)
(setq level (org-outline-level))
(forward-char 1)
(if (and (re-search-forward re nil t) (> (org-outline-level) level))
(progn (goto-char (match-beginning 0)) t)
(goto-char pos) nil)))))