Function: verb--request-spec-from-heading

verb--request-spec-from-heading is a natively compiled function defined in verb.el.

Signature

(verb--request-spec-from-heading POINT)

Documentation

Return a request spec from the current heading's text contents.

If a heading is found, get its contents using verb--heading-contents. From that result, try to parse a request specification. Return nil if the heading has no text contents, if contains only comments, or if the heading does not have the tag verb-tag. 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--request-spec-from-heading (point)
  "Return a request spec from the current heading's text contents.
If a heading is found, get its contents using
`verb--heading-contents'.  From that result, try to parse a request
specification.  Return nil if the heading has no text contents, if
contains only comments, or if the heading does not have the tag
`verb-tag'.
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 read request spec: not at a heading"))
  (when (or (member verb-tag (verb--heading-tags))
            (eq verb-tag t))
    (let ((text (verb--heading-contents point))
          (metadata (verb--heading-properties verb--metadata-prefix)))
      (unless (string-empty-p text)
        (condition-case nil
            (verb-request-spec-from-string text metadata)
          (verb-empty-spec nil))))))