Function: gdb-table-add-row

gdb-table-add-row is a byte-compiled function defined in gdb-mi.el.gz.

Signature

(gdb-table-add-row TABLE ROW &optional PROPERTIES)

Documentation

Add ROW of string to TABLE and recalculate column sizes.

When non-nil, PROPERTIES will be added to the whole row when calling gdb-table-string.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/gdb-mi.el.gz
(defun gdb-table-add-row (table row &optional properties)
  "Add ROW of string to TABLE and recalculate column sizes.

When non-nil, PROPERTIES will be added to the whole row when
calling `gdb-table-string'."
  (let ((rows (gdb-table-rows table))
        (row-properties (gdb-table-row-properties table))
        (column-sizes (gdb-table-column-sizes table)))
    (when (not column-sizes)
      (setf (gdb-table-column-sizes table)
            (make-list (length row) 0)))
    (setf (gdb-table-rows table)
          (append rows (list row)))
    (setf (gdb-table-row-properties table)
          (append row-properties (list properties)))
    (setf (gdb-table-column-sizes table)
          (cl-mapcar (lambda (x s)
                       (max (abs x) (string-width (or s ""))))
                       (gdb-table-column-sizes table)
                       row))
    ;; Avoid trailing whitespace at eol
    (if (not (gdb-table-right-align table))
        (setcar (last (gdb-table-column-sizes table)) 0))))