Subject: bug#14825: 24.3.50; split-window-below miscounts window lines

From: Eli Zaretskii <[email-masked]>
Date: Mon, 08 Jul 2013 20:52:49 +0300

To reproduce:

 emacs -Q
 Click S-mouse-1 and select "Change Buffer Font"
 Under "Size" type 6 and click OK

You should now have *scratch* buffer displayed with a very small font

 Hit RET 5 times to have a 10-line buffer
 C-x 2
 C-u 10 C-x ^

You should now have 2 windows displaying *scratch*, the lower one about
10 lines tall.

 C-x o
 C-x 2
  => Window #<window 0x3817df0 on *scratch*> too small for splitting

But that window is 10 lines tall, while the minimum window height is 4
lines, so I would expect Emacs to honor the request and produce 2
windows.  And indeed, if I do the same with a 10-line window without
making the font smaller, the window is split.

The reason for this seems to be that window.el and window.c do all
calculations in canonical lines, which is incorrect when the font of the
default face changes.  Moreover, the documentation barely hints on the
fact that "lines" actually means "canonical-height lines" in almost all
window-* functions that deal with vertical dimensions.

In GNU Emacs 24.3.50.32 (i686-pc-mingw32)
 of 2013-07-08 on HOME-C4E4A596F7
Bzr revision: 113326 [email-masked]
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --prefix=/d/usr --enable-checking CFLAGS=-O0 -gdwarf-2 -g3
 CPPFLAGS=-DGLYPH_DEBUG=1'

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1255
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  buffer-face-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<return> <return> <return> <return> <return> <S-down-mouse-1> 
C-x 2 C-u 1 0 C-x ^ C-x o C-x 2 C-x o M-x r e p o r 
t - e m <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Buffer-Face mode enabled
byte-code: Window #<window 0x3817df0 on *scratch*> too small for splitting

Load-path shadows:
None found.

Features:
(shadow sort nadvice gnus-util mail-extr emacsbug message format-spec
rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils face-remap time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp
w32-common-fns disp-table w32-win w32-vars 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 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 w32notify w32 multi-tty emacs)
To: 
Subject: 
--text follows this line--