Function: org-export-table-row-number

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

Signature

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

Documentation

Return TABLE-ROW number.

INFO is a plist used as a communication channel. Return value is zero-indexed and ignores separators. The function returns nil for special rows and separators.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox.el.gz
(defun org-export-table-row-number (table-row info)
  "Return TABLE-ROW number.
INFO is a plist used as a communication channel.  Return value is
zero-indexed and ignores separators.  The function returns nil
for special rows and separators."
  (when (eq (org-element-property :type table-row) 'standard)
    (let* ((cache (or (plist-get info :table-row-number-cache)
		      (let ((table (make-hash-table :test #'eq)))
			(plist-put info :table-row-number-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 ((number -1))
	  (org-element-map (org-export-get-parent-table table-row) 'table-row
	    (lambda (row)
	      (when (eq (org-element-property :type row) 'standard)
		(puthash row (cl-incf number) cache)))
	    info))
	(gethash table-row cache)))))