Function: org-columns--set-widths

org-columns--set-widths is a byte-compiled function defined in org-colview.el.gz.

Signature

(org-columns--set-widths CACHE)

Documentation

Compute the maximum column widths from the format and CACHE.

This function sets org-columns-current-maxwidths as a vector of integers greater than 0.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-colview.el.gz
(defun org-columns--set-widths (cache)
  "Compute the maximum column widths from the format and CACHE.
This function sets `org-columns-current-maxwidths' as a vector of
integers greater than 0."
  (setq org-columns-current-maxwidths
	(apply #'vector
	       (mapcar
		(lambda (spec)
		  (pcase spec
		    (`(,_ ,_ ,(and width (pred wholenump)) . ,_) width)
		    (`(,_ ,name . ,_)
		     ;; No width is specified in the columns format.
		     ;; Compute it by checking all possible values for
		     ;; PROPERTY.
		     (let ((width (length name)))
		       (dolist (entry cache width)
			 (let ((value (nth 2 (assoc spec (cdr entry)))))
			   (setq width (max (length value) width))))))))
		org-columns-current-fmt-compiled))))