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 list whose car is inline-babel-call and cdr a plist with :call,
:inside-header, :arguments, :end-header, :begin, :end,
:value and :post-blank as keywords. 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 list whose car is
`inline-babel-call' and cdr a plist with `:call',
`:inside-header', `:arguments', `:end-header', `:begin', `:end',
`:value' and `:post-blank' as keywords.  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 (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 (buffer-substring-no-properties begin (point)))
	       (post-blank (skip-chars-forward " \t"))
	       (end (point)))
	  (list '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)))))))