Subject: 24.4.50; `window-body-width' is not dynamic relative to font size changes

From: Joe Corneli <[email-masked]>
Date: Wed, 26 Nov 2014 13:47:14 +0000

Adjusting the font size, I would expect that the window's "body width"
would change -- more characters can be fit into the same amount of
screen space.  Current behaviour does not match this expectation.

M-: (window-body-width) RET  [Note result.]
C-x C--
M-: (window-body-width) RET  [Result is the same.]

The function is described:

"This function returns the width, in columns, of the body of window
window."

If for some reason the "nominal" number of columns needs to calculated
with reference to the default font, then there should be another
function to return the "actual" number of columns.

( I note one practical implication of the underlying issue here:
https://github.com/kiwanami/emacs-calfw/issues/45 )

In GNU Emacs 24.4.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2014-09-01 on Teacup
Repository revision: 117795 [email-masked]
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Ubuntu 14.04.1 LTS

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GSETTINGS NOTIFY GNUTLS
LIBXML2 FREETYPE XFT ZLIB

Important settings:
  value of $LC_MONETARY: en_GB.UTF-8
  value of $LC_NUMERIC: en_GB.UTF-8
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix

Major mode: Shell

Minor modes in effect:
  shell-dirtrack-mode: t
  openwith-mode: t
  show-paren-mode: t
  tooltip-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t

Recent input:
<up> <left> D M C-g C-x 1 C-x C-b C-x o <down> <down> 
<down> <return> C-x 1 <up> <C-left> C-s C-w C-w C-w 
C-s C-s C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-l <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> C-e M-x <up> C-g C-M-x 
e C-/ M-x e f d e b u <backspace> <backspace> <backspace> 
<backspace> <backspace> d e b u <tab> d e f <tab> <return> 
M-x <up> <up> <up> <return> n n n n n n n n n n n n 
n n n q <up> <up> <up> <up> <up> <up> M-b <left> <left> 
<left> <up> <up> <up> <up> <up> <C-left> C-r C-w C-w 
C-w C-r C-r C-r C-r C-r C-r C-r C-r C-r C-r C-r C-r 
C-r C-r <left> <right> C-SPC <C-right> M-w M-x g r 
e p <return> " C-y " SPC * <return> C-x o <down> <down> 
<down> <down> <return> C-e M-b M-b M-f C-h f <return> 
C-x o C-v C-l <up> <up> <up> <up> <up> C-l C-x C-b 
C-x o <down> <down> <down> <down> <down> C-g M-x <up> 
<up> <return> q M-x <up> <return> C-l <C-right> C-e 
C-x C-e M-x <up> <return> M-: <pause> C-y <return> 
M-: <up> <return> C-h v <up> C-e <M-backspace> b o 
d <tab> y C-g C-h f w i n d o w - b o d <tab> w <tab> 
<return> C-x b <return> C-a <right> <right> <right> 
<right> <right> <right> <left> <left> <help-echo> <help-echo> 
<S-down-mouse-1> M-: <up> <return> <S-down-mouse-1> 
M-x <up> <up> <up> <down> <down> C-g M-: <up> <return> 
C-x o M-x r e p o <tab> C-g C-z C-x 1 e m a c s SPC 
- Q <return> M-: <up> C-SPC C-e M-w C-g C-c C-c M-x 
r e p o <tab> r <tab> <return>

Recent messages:
cfw:view-month-calc-param
89 (#o131, #x59, ?Y) [2 times]
Quit
Type "q" to restore previous buffer, M-x scroll-up to scroll help.
89 (#o131, #x59, ?Y)
Quit
89 (#o131, #x59, ?Y)
Making completion list...
Quit [2 times]
Making completion list...

Load-path shadows:
~/mu/mu4e/mu4e-speedbar hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-speedbar
~/mu/mu4e/org-old-mu4e hides /usr/local/share/emacs/site-lisp/mu4e/org-old-mu4e
~/mu/mu4e/mu4e-draft hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-draft
~/mu/mu4e/mu4e-contrib hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-contrib
~/mu/mu4e/mu4e-proc hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-proc
~/mu/mu4e/mu4e-message hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-message
~/mu/mu4e/mu4e-headers hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-headers
~/mu/mu4e/mu4e-meta hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-meta
~/mu/mu4e/mu4e-vars hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-vars
~/mu/mu4e/mu4e-utils hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-utils
~/mu/mu4e/mu4e hides /usr/local/share/emacs/site-lisp/mu4e/mu4e
~/mu/mu4e/mu4e-lists hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-lists
~/mu/mu4e/mu4e-compose hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-compose
~/mu/mu4e/mu4e-main hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-main
~/mu/mu4e/org-mu4e hides /usr/local/share/emacs/site-lisp/mu4e/org-mu4e
~/mu/mu4e/mu4e-view hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-view
~/mu/mu4e/mu4e-about hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-about
~/mu/mu4e/mu4e-mark hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-mark
~/mu/mu4e/mu4e-actions hides /usr/local/share/emacs/site-lisp/mu4e/mu4e-actions
~/org-mode/lisp/org-crypt hides /usr/local/share/emacs/24.4.50/lisp/org/org-crypt
~/org-mode/lisp/org-mouse hides /usr/local/share/emacs/24.4.50/lisp/org/org-mouse
~/org-mode/lisp/ob-R hides /usr/local/share/emacs/24.4.50/lisp/org/ob-R
~/org-mode/lisp/org-indent hides /usr/local/share/emacs/24.4.50/lisp/org/org-indent
~/org-mode/lisp/ob-lilypond hides /usr/local/share/emacs/24.4.50/lisp/org/ob-lilypond
~/org-mode/lisp/org-mobile hides /usr/local/share/emacs/24.4.50/lisp/org/org-mobile
~/org-mode/lisp/ob-scheme hides /usr/local/share/emacs/24.4.50/lisp/org/ob-scheme
~/org-mode/lisp/ob-comint hides /usr/local/share/emacs/24.4.50/lisp/org/ob-comint
~/org-mode/lisp/org-eshell hides /usr/local/share/emacs/24.4.50/lisp/org/org-eshell
~/org-mode/lisp/ob-asymptote hides /usr/local/share/emacs/24.4.50/lisp/org/ob-asymptote
~/org-mode/lisp/ob-makefile hides /usr/local/share/emacs/24.4.50/lisp/org/ob-makefile
~/org-mode/lisp/org-w3m hides /usr/local/share/emacs/24.4.50/lisp/org/org-w3m
~/org-mode/lisp/org-colview hides /usr/local/share/emacs/24.4.50/lisp/org/org-colview
~/org-mode/lisp/org-install hides /usr/local/share/emacs/24.4.50/lisp/org/org-install
~/org-mode/lisp/org-bibtex hides /usr/local/share/emacs/24.4.50/lisp/org/org-bibtex
~/org-mode/lisp/ob-sqlite hides /usr/local/share/emacs/24.4.50/lisp/org/ob-sqlite
~/org-mode/lisp/org-element hides /usr/local/share/emacs/24.4.50/lisp/org/org-element
~/org-mode/lisp/org-timer hides /usr/local/share/emacs/24.4.50/lisp/org/org-timer
~/org-mode/lisp/ob-C hides /usr/local/share/emacs/24.4.50/lisp/org/ob-C
~/org-mode/lisp/ob-haskell hides /usr/local/share/emacs/24.4.50/lisp/org/ob-haskell
~/org-mode/lisp/ob-sql hides /usr/local/share/emacs/24.4.50/lisp/org/ob-sql
~/org-mode/lisp/ob-picolisp hides /usr/local/share/emacs/24.4.50/lisp/org/ob-picolisp
~/org-mode/lisp/ob-java hides /usr/local/share/emacs/24.4.50/lisp/org/ob-java
~/org-mode/lisp/org-footnote hides /usr/local/share/emacs/24.4.50/lisp/org/org-footnote
~/org-mode/lisp/ox-html hides /usr/local/share/emacs/24.4.50/lisp/org/ox-html
~/org-mode/lisp/ob-latex hides /usr/local/share/emacs/24.4.50/lisp/org/ob-latex
~/org-mode/lisp/ob-screen hides /usr/local/share/emacs/24.4.50/lisp/org/ob-screen
~/org-mode/lisp/ob-css hides /usr/local/share/emacs/24.4.50/lisp/org/ob-css
~/org-mode/lisp/org-attach hides /usr/local/share/emacs/24.4.50/lisp/org/org-attach
~/org-mode/lisp/ob-ditaa hides /usr/local/share/emacs/24.4.50/lisp/org/ob-ditaa
~/org-mode/lisp/ob-shen hides /usr/local/share/emacs/24.4.50/lisp/org/ob-shen
~/org-mode/lisp/org-feed hides /usr/local/share/emacs/24.4.50/lisp/org/org-feed
~/org-mode/lisp/ob-keys hides /usr/local/share/emacs/24.4.50/lisp/org/ob-keys
~/org-mode/lisp/ob-exp hides /usr/local/share/emacs/24.4.50/lisp/org/ob-exp
~/org-mode/lisp/org-datetree hides /usr/local/share/emacs/24.4.50/lisp/org/org-datetree
~/org-mode/lisp/org-macs hides /usr/local/share/emacs/24.4.50/lisp/org/org-macs
~/org-mode/lisp/ob-ruby hides /usr/local/share/emacs/24.4.50/lisp/org/ob-ruby
~/org-mode/lisp/ob-mscgen hides /usr/local/share/emacs/24.4.50/lisp/org/ob-mscgen
~/org-mode/lisp/ob-fortran hides /usr/local/share/emacs/24.4.50/lisp/org/ob-fortran
~/org-mode/lisp/org-irc hides /usr/local/share/emacs/24.4.50/lisp/org/org-irc
~/org-mode/lisp/org-version hides /usr/local/share/emacs/24.4.50/lisp/org/org-version
~/org-mode/lisp/ox-beamer hides /usr/local/share/emacs/24.4.50/lisp/org/ox-beamer
~/org-mode/lisp/ob-ref hides /usr/local/share/emacs/24.4.50/lisp/org/ob-ref
~/org-mode/lisp/org-rmail hides /usr/local/share/emacs/24.4.50/lisp/org/org-rmail
~/org-mode/lisp/ox hides /usr/local/share/emacs/24.4.50/lisp/org/ox
~/org-mode/lisp/ob-perl hides /usr/local/share/emacs/24.4.50/lisp/org/ob-perl
~/org-mode/lisp/org-agenda hides /usr/local/share/emacs/24.4.50/lisp/org/org-agenda
~/org-mode/lisp/org-habit hides /usr/local/share/emacs/24.4.50/lisp/org/org-habit
~/org-mode/lisp/org-compat hides /usr/local/share/emacs/24.4.50/lisp/org/org-compat
~/org-mode/lisp/ox-md hides /usr/local/share/emacs/24.4.50/lisp/org/ox-md
~/org-mode/lisp/org-plot hides /usr/local/share/emacs/24.4.50/lisp/org/org-plot
~/org-mode/lisp/ob-clojure hides /usr/local/share/emacs/24.4.50/lisp/org/ob-clojure
~/org-mode/lisp/ob-matlab hides /usr/local/share/emacs/24.4.50/lisp/org/ob-matlab
~/org-mode/lisp/ob-core hides /usr/local/share/emacs/24.4.50/lisp/org/ob-core
~/org-mode/lisp/ob-tangle hides /usr/local/share/emacs/24.4.50/lisp/org/ob-tangle
~/org-mode/lisp/org-loaddefs hides /usr/local/share/emacs/24.4.50/lisp/org/org-loaddefs
~/org-mode/lisp/org-ctags hides /usr/local/share/emacs/24.4.50/lisp/org/org-ctags
~/org-mode/lisp/org-docview hides /usr/local/share/emacs/24.4.50/lisp/org/org-docview
~/org-mode/lisp/ob-ledger hides /usr/local/share/emacs/24.4.50/lisp/org/ob-ledger
~/org-mode/lisp/org hides /usr/local/share/emacs/24.4.50/lisp/org/org
~/org-mode/lisp/org-protocol hides /usr/local/share/emacs/24.4.50/lisp/org/org-protocol
~/org-mode/lisp/ox-latex hides /usr/local/share/emacs/24.4.50/lisp/org/ox-latex
~/org-mode/lisp/ob-gnuplot hides /usr/local/share/emacs/24.4.50/lisp/org/ob-gnuplot
~/org-mode/lisp/ob-sass hides /usr/local/share/emacs/24.4.50/lisp/org/ob-sass
~/org-mode/lisp/org-pcomplete hides /usr/local/share/emacs/24.4.50/lisp/org/org-pcomplete
~/org-mode/lisp/ob hides /usr/local/share/emacs/24.4.50/lisp/org/ob
~/org-mode/lisp/ox-odt hides /usr/local/share/emacs/24.4.50/lisp/org/ox-odt
~/org-mode/lisp/ob-lob hides /usr/local/share/emacs/24.4.50/lisp/org/ob-lob
~/org-mode/lisp/ob-table hides /usr/local/share/emacs/24.4.50/lisp/org/ob-table
~/org-mode/lisp/org-mhe hides /usr/local/share/emacs/24.4.50/lisp/org/org-mhe
~/org-mode/lisp/ob-dot hides /usr/local/share/emacs/24.4.50/lisp/org/ob-dot
~/org-mode/lisp/ob-octave hides /usr/local/share/emacs/24.4.50/lisp/org/ob-octave
~/org-mode/lisp/ob-calc hides /usr/local/share/emacs/24.4.50/lisp/org/ob-calc
~/org-mode/lisp/ob-scala hides /usr/local/share/emacs/24.4.50/lisp/org/ob-scala
~/org-mode/lisp/ox-texinfo hides /usr/local/share/emacs/24.4.50/lisp/org/ox-texinfo
~/org-mode/lisp/org-macro hides /usr/local/share/emacs/24.4.50/lisp/org/org-macro
~/org-mode/lisp/ox-ascii hides /usr/local/share/emacs/24.4.50/lisp/org/ox-ascii
~/org-mode/lisp/ob-org hides /usr/local/share/emacs/24.4.50/lisp/org/ob-org
~/org-mode/lisp/ob-plantuml hides /usr/local/share/emacs/24.4.50/lisp/org/ob-plantuml
~/org-mode/lisp/org-gnus hides /usr/local/share/emacs/24.4.50/lisp/org/org-gnus
~/org-mode/lisp/ox-man hides /usr/local/share/emacs/24.4.50/lisp/org/ox-man
~/org-mode/lisp/ob-emacs-lisp hides /usr/local/share/emacs/24.4.50/lisp/org/ob-emacs-lisp
~/org-mode/lisp/ob-ocaml hides /usr/local/share/emacs/24.4.50/lisp/org/ob-ocaml
~/org-mode/lisp/org-faces hides /usr/local/share/emacs/24.4.50/lisp/org/org-faces
~/org-mode/lisp/org-clock hides /usr/local/share/emacs/24.4.50/lisp/org/org-clock
~/org-mode/lisp/org-src hides /usr/local/share/emacs/24.4.50/lisp/org/org-src
~/org-mode/lisp/ob-lisp hides /usr/local/share/emacs/24.4.50/lisp/org/ob-lisp
~/org-mode/lisp/org-list hides /usr/local/share/emacs/24.4.50/lisp/org/org-list
~/org-mode/lisp/ob-js hides /usr/local/share/emacs/24.4.50/lisp/org/ob-js
~/org-mode/lisp/ob-maxima hides /usr/local/share/emacs/24.4.50/lisp/org/ob-maxima
~/org-mode/lisp/ox-publish hides /usr/local/share/emacs/24.4.50/lisp/org/ox-publish
~/org-mode/lisp/org-archive hides /usr/local/share/emacs/24.4.50/lisp/org/org-archive
~/org-mode/lisp/ob-awk hides /usr/local/share/emacs/24.4.50/lisp/org/ob-awk
~/org-mode/lisp/ob-io hides /usr/local/share/emacs/24.4.50/lisp/org/ob-io
~/org-mode/lisp/ob-python hides /usr/local/share/emacs/24.4.50/lisp/org/ob-python
~/org-mode/lisp/ox-icalendar hides /usr/local/share/emacs/24.4.50/lisp/org/ox-icalendar
~/org-mode/lisp/org-bbdb hides /usr/local/share/emacs/24.4.50/lisp/org/org-bbdb
~/org-mode/lisp/org-id hides /usr/local/share/emacs/24.4.50/lisp/org/org-id
~/org-mode/lisp/org-capture hides /usr/local/share/emacs/24.4.50/lisp/org/org-capture
~/org-mode/lisp/org-entities hides /usr/local/share/emacs/24.4.50/lisp/org/org-entities
~/org-mode/lisp/ox-org hides /usr/local/share/emacs/24.4.50/lisp/org/ox-org
~/org-mode/lisp/org-inlinetask hides /usr/local/share/emacs/24.4.50/lisp/org/org-inlinetask
~/org-mode/lisp/org-info hides /usr/local/share/emacs/24.4.50/lisp/org/org-info
~/org-mode/lisp/ob-eval hides /usr/local/share/emacs/24.4.50/lisp/org/ob-eval
~/org-mode/lisp/org-table hides /usr/local/share/emacs/24.4.50/lisp/org/org-table
~/postdoc.git/elisp/lisp-mode hides /usr/local/share/emacs/24.4.50/lisp/emacs-lisp/lisp-mode

Features:
(shadow emacsbug eieio-opt grep edebug rect cus-edit cus-start cus-load
image-file qp tabify cal-move help-mode cal-china lunar solar cal-dst
cal-bahai cal-islam cal-hebrew diary-lib diary-loaddefs dired-aux vc-git
tex-mode compile latexenc pcmpl-unix ispell misearch multi-isearch
mailalias mail-extr sort face-remap timezone gnutls network-stream
starttls url-http url-gw url-auth url-queue url-cache shr-color
mule-util shell poly-markdown polymode pcase poly-base polymode-weave
polymode-export polymode-methods polymode-classes polymode-common
eieio-custom eieio-base color markdown-mode thingatpt openwith joes-dict
dictem calfw-org org-capture calfw holidays hol-loaddefs htmlize
convenience joes-dired-config ls-lisp joes-buffer-menu-config joes-eww
eww mm-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util url-parse url-vars mailcap joes-org-mode
ox-s5 org-agenda ox-latex ox-icalendar ox-html ox-ascii ox-publish ox
org-rmail org-mhe org-irc org-info org-gnus org-docview org-bibtex
bibtex org-bbdb org-w3m gnus-sum gnus-group gnus-undo gnus-start
gnus-cloud nnimap nnmail mail-source tls utf7 netrc nnoo parse-time
gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems nnheader wid-edit
org-element avl-tree org-install joes-mu4e-config org-mu4e org org-macro
org-footnote org-pcomplete pcomplete org-list org-faces org-entities
noutline outline easy-mmode org-version ob-emacs-lisp ob ob-tangle
org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval
org-compat org-macs org-loaddefs find-func cal-menu calendar
cal-loaddefs shr smtpmail-multi mu4e mu4e-speedbar speedbar sb-image
ezimage dframe mu4e-main mu4e-view epa derived epg epg-config browse-url
comint ansi-color ring mu4e-headers mu4e-compose mu4e-draft mu4e-actions
ido rfc2368 smtpmail auth-source eieio byte-opt bytecomp byte-compile
cconv eieio-core gnus-util password-cache sendmail mu4e-mark
mu4e-message html2text mu4e-proc mu4e-utils doc-view jka-compr
image-mode mu4e-lists mu4e-about mu4e-vars message cl-macs dired
format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mailabbrev mail-utils gmm-utils mailheader hl-line cl gv mu4e-meta
generic generic-x advice help-fns edmacro kmacro cl-loaddefs cl-lib
paren time-date tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process gfilenotify
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)

Memory information:
((conses 16 633853 89119)
 (symbols 48 45326 4)
 (miscs 40 4504 2420)
 (strings 32 104101 9049)
 (string-bytes 1 3520659)
 (vectors 16 42195)
 (vector-slots 8 1492748 165381)
 (floats 8 1084 572)
 (intervals 56 12494 1976)
 (buffers 976 67)
 (heap 1024 63592 6821))