Function: trashed-update-col-width

trashed-update-col-width is a natively compiled function defined in trashed.el.

Signature

(trashed-update-col-width COL WIDTH)

Documentation

Update column COL's width with WIDTH.

If WIDTH is nil, set width to its header name width. If WIDTH is a number and greater than current width, set current width to WIDTH.

Source Code

;; Defined in /nix/store/7ppdacjhnynz276lxxnfw8sdz6r2k6h2-emacs-packages-deps/share/emacs/site-lisp/elpa/trashed-20230811.157/trashed.el
(defun trashed-update-col-width (col width)
  "Update column COL's width with WIDTH.
If WIDTH is nil, set width to its header name width.
If WIDTH is a number and greater than current width,
set current width to WIDTH."
  (let ((current-width (cdr (aref tabulated-list-format col))))
    (if (not width)
        (let ((column-name (car (aref tabulated-list-format col))))
          ;; 3 = 1 blank + sorting arrow width which could be 2
          (setcar current-width (+ (string-width column-name) 3)))
      (if (> width (car current-width))
          (setcar current-width width)))))