Function: org-element-parse-secondary-string

org-element-parse-secondary-string is a byte-compiled function defined in org-element.el.gz.

Signature

(org-element-parse-secondary-string STRING RESTRICTION &optional PARENT)

Documentation

Recursively parse objects in STRING and return structure.

RESTRICTION is a symbol limiting the object types that will be looked after.

Optional argument PARENT, when non-nil, is the element or object containing the secondary string. It is used to set correctly
:parent property within the string.

If STRING is the empty string or nil, return nil.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-element.el.gz
(defun org-element-parse-secondary-string (string restriction &optional parent)
  "Recursively parse objects in STRING and return structure.

RESTRICTION is a symbol limiting the object types that will be
looked after.

Optional argument PARENT, when non-nil, is the element or object
containing the secondary string.  It is used to set correctly
`:parent' property within the string.

If STRING is the empty string or nil, return nil."
  (cond
   ((not string) nil)
   ((equal string "") nil)
   (t (let (rtn)
	(org-element-with-buffer-copy
         :to-buffer (org-get-buffer-create " *Org parse*" t)
         :drop-contents t
         :drop-visibility t
         :drop-narrowing t
         :drop-locals nil
	 ;; Transferring local variables may put the temporary buffer
	 ;; into a read-only state.  Make sure we can insert STRING.
	 (let ((inhibit-read-only t)) (erase-buffer) (insert string))
	 ;; Prevent "Buffer *temp* modified; kill anyway?".
	 (restore-buffer-modified-p nil)
         (setq rtn
	       (org-element--parse-objects
                (point-min) (point-max) nil restriction parent))
         ;; Resolve deferred.
         (org-element-map rtn t
           (lambda (el) (org-element-properties-resolve el t)))
         rtn)))))