Function: rst-stn-containing-point
rst-stn-containing-point is a byte-compiled function defined in
rst.el.gz.
Signature
(rst-stn-containing-point STN &optional POINT)
Documentation
Return rst-Stn in STN before POINT or nil if in no section.
POINT defaults to the current point. STN may be nil for no section headers at all.
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/rst.el.gz
(defun rst-stn-containing-point (stn &optional point)
;; testcover: ok.
"Return `rst-Stn' in STN before POINT or nil if in no section.
POINT defaults to the current point. STN may be nil for no
section headers at all."
(when stn
(setq point (or point (point)))
(when (>= point (rst-Stn-get-title-beginning stn))
;; Point may be in this section or a child.
(let ((in-child (cl-find-if
(lambda (child)
(>= point (rst-Stn-get-title-beginning child)))
(rst-Stn-children stn)
:from-end t)))
(if in-child
(rst-stn-containing-point in-child point)
stn)))))