The result of
window-body-width doesn't change when
display-line-number-mode is enabled / disabled.
How can I get the window width but excluding the fringe?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
window-max-chars-per-line does exactly this.
Found in the emacs manual: the effective width of the window in characters.
For e.g., its return value does change based on whether or not line numbers are enabled in the current buffer. It can do this for any face via an optional argument.