Function: org-table-shrink

org-table-shrink is an autoloaded, interactive and byte-compiled function defined in org-table.el.gz.

Signature

(org-table-shrink &optional BEGIN END)

Documentation

Shrink all columns with a width cookie in the table at point.

Columns without a width cookie are expanded.

Optional arguments BEGIN and END, when non-nil, specify the beginning and end position of the current table.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-table.el.gz
;;;###autoload
(defun org-table-shrink (&optional begin end)
  "Shrink all columns with a width cookie in the table at point.

Columns without a width cookie are expanded.

Optional arguments BEGIN and END, when non-nil, specify the
beginning and end position of the current table."
  (interactive)
  (unless (or begin (org-at-table-p)) (user-error "Not at a table"))
  (org-with-wide-buffer
   (let ((begin (or begin (org-table-begin)))
	 (end (or end (org-table-end)))
	 (regexp "|[ \t]*<[lrc]?[0-9]+>[ \t]*\\(|\\|$\\)")
	 (columns))
     (goto-char begin)
     (while (re-search-forward regexp end t)
       (goto-char (match-beginning 1))
       (cl-pushnew (org-table-current-column) columns))
     (org-table-expand begin end)
     ;; Make sure invisible characters in the table are at the right
     ;; place since column widths take them into account.
     (org-font-lock-ensure begin end)
     (org-table--shrink-columns (sort columns #'<) begin end))))