Function: org-export-get-next-element

org-export-get-next-element is a byte-compiled function defined in ox.el.gz.

Signature

(org-export-get-next-element BLOB INFO &optional N)

Documentation

Return next element or object.

BLOB is an element or object. INFO is a plist used as a communication channel. Return next exportable element or object, a string, or nil.

When optional argument N is a positive integer, return a list containing up to N siblings after BLOB, from closest to farthest. With any other non-nil value, return a list containing all of them.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox.el.gz
(defun org-export-get-next-element (blob info &optional n)
  "Return next element or object.

BLOB is an element or object.  INFO is a plist used as
a communication channel.  Return next exportable element or
object, a string, or nil.

When optional argument N is a positive integer, return a list
containing up to N siblings after BLOB, from closest to farthest.
With any other non-nil value, return a list containing all of
them."
  (let* ((secondary (org-element-secondary-p blob))
	 (parent (org-export-get-parent blob))
	 (siblings
	  (cdr (memq blob
		     (if secondary (org-element-property secondary parent)
		       (org-element-contents parent)))))
	 next)
    (catch 'exit
      (dolist (obj siblings (nreverse next))
	(cond ((memq obj (plist-get info :ignore-list)))
	      ((null n) (throw 'exit obj))
	      ((not (wholenump n)) (push obj next))
	      ((zerop n) (throw 'exit (nreverse next)))
	      (t (cl-decf n) (push obj next)))))))