Function: org-export-table-has-special-column-p

org-export-table-has-special-column-p is a byte-compiled function defined in ox.el.gz.

Signature

(org-export-table-has-special-column-p TABLE)

Documentation

Non-nil when TABLE has a special column.

All special columns will be ignored during export.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox.el.gz
;;;; For Tables
;;
;; `org-export-table-has-special-column-p' and
;; `org-export-table-row-is-special-p' are predicates used to look for
;; meta-information about the table structure.
;;
;; `org-export-table-cell-width', `org-export-table-cell-alignment'
;; and `org-export-table-cell-borders' extract information from
;; a table-cell element.
;;
;; `org-export-table-dimensions' gives the number on rows and columns
;; in the table, ignoring horizontal rules and special columns.
;; `org-export-table-cell-address', given a table-cell object, returns
;; the absolute address of a cell. On the other hand,
;; `org-export-get-table-cell-at' does the contrary.
;;
;; `org-export-table-cell-starts-colgroup-p',
;; `org-export-table-cell-ends-colgroup-p',
;; `org-export-table-row-starts-rowgroup-p',
;; `org-export-table-row-ends-rowgroup-p',
;; `org-export-table-row-starts-header-p',
;; `org-export-table-row-ends-header-p' and
;; `org-export-table-row-in-header-p' indicate position of current row
;; or cell within the table.

(defun org-export-table-has-special-column-p (table)
  "Non-nil when TABLE has a special column.
All special columns will be ignored during export."
  ;; The table has a special column when every first cell of every row
  ;; has an empty value or contains a symbol among "/", "#", "!", "$",
  ;; "*" "_" and "^".  Though, do not consider a first column
  ;; containing only empty cells as special.
  (let ((special-column? 'empty))
    (catch 'exit
      (dolist (row (org-element-contents table))
	(when (eq (org-element-property :type row) 'standard)
	  (let ((value (org-element-contents
			(car (org-element-contents row)))))
	    (cond ((member value
			   '(("/") ("#") ("!") ("$") ("*") ("_") ("^")))
		   (setq special-column? 'special))
		  ((null value))
		  (t (throw 'exit nil))))))
      (eq special-column? 'special))))