Function: org-element-inline-babel-call-parser
org-element-inline-babel-call-parser is a byte-compiled function
defined in org-element.el.gz.
Signature
(org-element-inline-babel-call-parser)
Documentation
Parse inline babel call at point, if any.
When at an inline babel call, return a new syntax node of
inline-babel-call type containing :call, :inside-header,
:arguments, :end-header, :begin, :end, :value and
:post-blank as properties. Otherwise, return nil.
Assume point is at the beginning of the babel call.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-element.el.gz
;;;; Inline Babel Call
(defun org-element-inline-babel-call-parser ()
"Parse inline babel call at point, if any.
When at an inline babel call, return a new syntax node of
`inline-babel-call' type containing `:call', `:inside-header',
`:arguments', `:end-header', `:begin', `:end', `:value' and
`:post-blank' as properties. Otherwise, return nil.
Assume point is at the beginning of the babel call."
(save-excursion
(catch :no-object
(when (let ((case-fold-search nil))
(looking-at "\\<call_\\([^ \t\n[(]+\\)[([]"))
(goto-char (match-end 1))
(let* ((begin (match-beginning 0))
(call (org-element--get-cached-string
(match-string-no-properties 1)))
(inside-header
(let ((p (org-element--parse-paired-brackets ?\[)))
(and (org-string-nw-p p)
(replace-regexp-in-string "\n[ \t]*" " " (org-trim p)))))
(arguments (org-string-nw-p
(or (org-element--parse-paired-brackets ?\()
;; Parenthesis are mandatory.
(throw :no-object nil))))
(end-header
(let ((p (org-element--parse-paired-brackets ?\[)))
(and (org-string-nw-p p)
(replace-regexp-in-string "\n[ \t]*" " " (org-trim p)))))
(value
(org-element-deferred-create
t #'org-element--substring
0 (- (point) begin)))
(post-blank (skip-chars-forward " \t"))
(end (point)))
(org-element-create
'inline-babel-call
(list :call call
:inside-header inside-header
:arguments arguments
:end-header end-header
:begin begin
:end end
:value value
:post-blank post-blank)))))))