Function: org-table--list-shrunk-columns

org-table--list-shrunk-columns is a byte-compiled function defined in org-table.el.gz.

Signature

(org-table--list-shrunk-columns)

Documentation

List currently shrunk columns in table at point.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-table.el.gz
(defun org-table--list-shrunk-columns ()
  "List currently shrunk columns in table at point."
  (save-excursion
    ;; We really check shrunk columns in current row only.  It could
    ;; be wrong if all rows do not contain the same number of columns
    ;; (i.e. the table is not properly aligned).  As a consequence,
    ;; some columns may not be shrunk again upon aligning the table.
    ;;
    ;; For example, in the following table, cursor is on first row and
    ;; "<>" indicates a shrunk column.
    ;;
    ;; | |
    ;; | | <> |
    ;;
    ;; Aligning table from the first row will not shrink again the
    ;; second row, which was not visible initially.
    ;;
    ;; However, fixing it requires checking every row, which may be
    ;; slow on large tables.  Moreover, the hindrance of this
    ;; pathological case is very limited.
    (forward-line 0)
    (search-forward "|")
    (let ((separator (if (org-at-table-hline-p) "+" "|"))
	  (column 1)
	  (shrunk (and (org-table--shrunk-field) (list 1)))
	  (end (line-end-position)))
      (while (search-forward separator end t)
	(cl-incf column)
	(when (org-table--shrunk-field) (push column shrunk)))
      (nreverse shrunk))))