(window-total-width)
returns the number of columns (characters) that fit in the current window (https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Sizes.html). This will take the current font into account. My header line or mode line might have a different font from the text area (window body). How can I get the number of columns (characters) that fit there instead?
(/ (window-pixel-width)
(window-font-width nil face))
will return the current window width for a given face.
with-selected-window
....? – lawlist Feb 26 '20 at 21:06