Function: vtable--compute-width

vtable--compute-width is a byte-compiled function defined in vtable.el.gz.

Signature

(vtable--compute-width TABLE SPEC)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/vtable.el.gz
(defun vtable--compute-width (table spec)
  (cond
   ((numberp spec)
    (* spec (vtable--char-width table)))
   ((string-match "\\([0-9.]+\\)ex" spec)
    (* (string-to-number (match-string 1 spec)) (vtable--char-width table)))
   ((string-match "\\([0-9.]+\\)px" spec)
    (string-to-number (match-string 1 spec)))
   ((string-match "\\([0-9.]+\\)%" spec)
    (/ (* (string-to-number (match-string 1 spec)) (window-width nil t))
       100))
   (t
    (error "Invalid spec: %s" spec))))