Function: which-key--text-width-to-total

which-key--text-width-to-total is a byte-compiled function defined in which-key.el.gz.

Signature

(which-key--text-width-to-total TEXT-WIDTH)

Documentation

Convert window TEXT-WIDTH to window total-width.

TEXT-WIDTH is the desired text width of the window. The function calculates what total width is required for a window in the selected to have a text-width of TEXT-WIDTH columns. The calculation considers possible fringes and scroll bars. This function assumes that the desired window has the same character width as the frame.

Source Code

;; Defined in /usr/src/emacs/lisp/which-key.el.gz
;;; Functions for computing window sizes

(defun which-key--text-width-to-total (text-width)
  "Convert window TEXT-WIDTH to window total-width.
TEXT-WIDTH is the desired text width of the window.  The function
calculates what total width is required for a window in the
selected to have a text-width of TEXT-WIDTH columns.  The
calculation considers possible fringes and scroll bars.  This
function assumes that the desired window has the same character
width as the frame."
  (let ((char-width (frame-char-width)))
    (+ text-width
       (/ (frame-fringe-width) char-width)
       (/ (frame-scroll-bar-width) char-width)
       (if (which-key--char-enlarged-p) 1 0)
       ;; add padding to account for possible wide (unicode) characters
       3)))