Function: org-export-table-row-group

org-export-table-row-group is a byte-compiled function defined in ox.el.gz.

Signature

(org-export-table-row-group TABLE-ROW INFO)

Documentation

Return TABLE-ROW's group number, as an integer.

INFO is a plist used as the communication channel.

Return value is the group number, as an integer, or nil for special rows and rows separators. First group is also table's header.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox.el.gz
(defun org-export-table-row-group (table-row info)
  "Return TABLE-ROW's group number, as an integer.

INFO is a plist used as the communication channel.

Return value is the group number, as an integer, or nil for
special rows and rows separators.  First group is also table's
header."
  (when (eq (org-element-property :type table-row) 'standard)
    (let* ((cache (or (plist-get info :table-row-group-cache)
		      (let ((table (make-hash-table :test #'eq)))
			(plist-put info :table-row-group-cache table)
			table)))
	   (cached (gethash table-row cache 'no-cache)))
      (if (not (eq cached 'no-cache)) cached
	;; First time a row is queried, populate cache with all the
	;; rows from the table.
	(let ((group 0) row-flag)
	  (org-element-map (org-export-get-parent table-row) 'table-row
	    (lambda (row)
	      (if (eq (org-element-property :type row) 'rule)
		  (setq row-flag nil)
		(unless row-flag (cl-incf group) (setq row-flag t))
		(puthash row group cache)))
	    info))
	(gethash table-row cache)))))