Function: verb--heading-contents
verb--heading-contents is a natively compiled function defined in
verb.el.
Signature
(verb--heading-contents &optional POINT)
Documentation
Return text under the current heading, with some conditions.
If one or more Babel source blocks are present in the text, and the point is located inside one of them, return the content of that source block. Otherwise, simply return the all the text content under the current heading. Additionally, assume point was at position POINT before it was moved to the heading. If not on a heading, signal an error.
Source Code
;; Defined in /nix/store/8jnfn8w2mxcxbr2crbklcnija9m0zlkq-emacs-packages-deps/share/emacs/site-lisp/elpa/verb-20260818.1921/verb.el
(defun verb--heading-contents (&optional point)
"Return text under the current heading, with some conditions.
If one or more Babel source blocks are present in the text, and the
point is located inside one of them, return the content of that source
block. Otherwise, simply return the all the text content under the
current heading.
Additionally, assume point was at position POINT before it was moved
to the heading.
If not on a heading, signal an error."
(unless (org-at-heading-p)
(user-error "%s" "Can't get heading text contents: not at a heading"))
(let ((start (save-excursion
(end-of-line)
(unless (eobp) (forward-char))
(point)))
(end (save-excursion
(goto-char (org-entry-end-position))
(when (and (org-at-heading-p)
(not (eobp)))
(backward-char))
(point))))
(when (< end start) (setq end start))
(verb--maybe-extract-babel-src-block point start end)))