Function: tabulated-list-widen-current-column

tabulated-list-widen-current-column is an interactive and byte-compiled function defined in tabulated-list.el.gz.

Signature

(tabulated-list-widen-current-column &optional N)

Documentation

Widen the current tabulated-list column by N chars.

Interactively, N is the prefix numeric argument, and defaults to
1.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/tabulated-list.el.gz
(defun tabulated-list-widen-current-column (&optional n)
  "Widen the current tabulated-list column by N chars.
Interactively, N is the prefix numeric argument, and defaults to
1."
  (interactive "p")
  (let ((start (current-column))
        (entry (tabulated-list-get-entry))
        (nb-cols (length tabulated-list-format))
        (col-nb 0)
        (total-width 0)
        (found nil)
        col-width)
    (while (and (not found)
                (< col-nb nb-cols))
      (if (>= start
              (setq total-width
                    (+ total-width
                       (max (setq col-width
                                  (cadr (aref tabulated-list-format
                                              col-nb)))
                            (let ((desc (aref entry col-nb)))
                              (string-width (if (stringp desc)
                                                desc
                                              (car desc)))))
                       (or (plist-get (nthcdr 3 (aref tabulated-list-format
                                                      col-nb))
                                      :pad-right)
                           1))))
          (setq col-nb (1+ col-nb))
        (setq found t)
        ;; `tabulated-list-format' may be a constant (sharing list
        ;; structures), so copy it before mutating.
        (setq tabulated-list-format (copy-tree tabulated-list-format t))
        (setf (cadr (aref tabulated-list-format col-nb))
              (max 1 (+ col-width n)))
        (tabulated-list-print t)
        (tabulated-list-init-header)))))