@end defun
@item align
-Should be either @code{right} or @code{left}.
+Should be either @code{right} or @code{left}. If not specified,
+numerical values will be flushed to the right, and all other values will
+be flushed to the left.
@end table
@item :getter
(@pxref{Interface Functions}) to determine what that object is.
@item :separator-width
-The width of the blank space between columns.
+The width of the blank space between columns. If not specified, it
+defaults to 1.
@item :divider-width
@itemx :divider
-You can have a divider inserted between the columns. This can either
-be specified by using @code{:divider}, which should be a string to be
-displayed between the columns, or @code{:divider-width}, which
-specifies the width of the space to be used as the divider.
+You can have a divider inserted between the columns. This can either be
+specified by using @code{:divider}, which should be a string to be
+displayed between the columns, or @code{:divider-width}, which specifies
+the width of the space to be used as the divider, in units of characters
+of the face used to display the table. If not specified,
+@code{:divider} defaults to @code{nil}, but specifying
+@code{:divider-width} effectively sets the divider to a whitespace
+string of that width.
@item :sort-by
This should be a list of tuples, and specifies how the table is to be
(vtable--limit-string
name (- (elt widths index) indicator-width))
name))
- (let ((fill-width
- (+ (- (elt widths index)
- (string-pixel-width displayed)
- indicator-width
- (vtable-separator-width table)
- ;; We want the indicator to not be quite flush
- ;; right.
- (/ (vtable--char-width table) 2.0))
- (if last 0 spacer))))
+ (let* ((indicator-lead-width
+ ;; We want the indicator to not be quite flush right.
+ (/ (vtable--char-width table) 2.0))
+ (indicator-pad-width (- (vtable--char-width table)
+ indicator-lead-width))
+ (fill-width
+ (+ (- (elt widths index)
+ (string-pixel-width displayed)
+ indicator-width
+ indicator-lead-width)
+ (if last 0 spacer))))
(if (or (not last)
(zerop indicator-width)
(< (seq-reduce #'+ widths 0) (window-width nil t)))
displayed
(propertize " " 'display
(list 'space :width (list fill-width)))
- indicator)
+ indicator
+ (propertize " " 'display
+ (list 'space :width (list indicator-pad-width))))
;; This is the final column, and we have a sorting
;; indicator, and the table is too wide for the window.
(let* ((pre-indicator (string-pixel-width
(list (- fill-width pre-fill))))))))
(when (and divider (not last))
(insert (propertize divider 'keymap dmap)))
- (insert (propertize
- " " 'display
- (list 'space :width (list
- (/ (vtable--char-width table) 2.0)))))
(put-text-property start (point) 'vtable-column index)))
(vtable-columns table))
(insert "\n")