Subject: bug#17077: 24.4.50; regression: `set-frame-size' results in wrong frame size

From: Drew Adams <[email-masked]>
Date: Sun, 23 Mar 2014 15:35:02 -0700 (PDT)

This build does not give the correct result when using `set-frame-size'.

In previous builds and releases, including a build as recent as
2014-03-11, (set-frame-size 75 64) ends up with these frame parameters
(using my setup, for a special-display frame):

((top + -1)
 (left + -2)
 (buried-buffer-list)
 (buffer-list #<buffer *Bookmark List*>)
 (width . 75) ; <==============================
 (height . 62)
 (tool-bar-position . top)
 (parent-id)
 (explicit-name . t)
 (display . "w32")
 (visibility . t)
 (icon-name)
 (window-id . "3476582")
 (unsplittable . t)
 (minibuffer)
 (modeline . t)
 (thumfr-non-thumbnail-frame
  (top . 12)
  (left . 4)
  (buried-buffer-list)
  (buffer-list #<buffer *Bookmark List*>)
  (width . 118)
  (height . 67)
  (tool-bar-position . top)
  (parent-id)
  (explicit-name . t)
  (display . "w32")
  (visibility . t)
  (icon-name)
  (window-id . "3476582")
  (unsplittable . t)
  (minibuffer)
  (modeline . t)
  (name . "*Bookmark List*")
  (zoomed . -2)
  (cursor-color . "Yellow")
  (background-mode . light)
  (display-type . color)
  (fringe . 0)
  (scroll-bar-width . 6)
  (cursor-type . bar)
  (auto-lower)
  (auto-raise)
  (icon-type)
  (fullscreen)
  (title)
  (buffer-predicate)
  (tool-bar-lines . 0)
  (menu-bar-lines . 0)
  (alpha)
  (right-fringe . 0)
  (left-fringe . 0)
  (line-spacing)
  (screen-gamma)
  (border-color . "black")
  (mouse-color . "Yellow")
  (background-color . "LightSteelBlue")
  (foreground-color . "Black")
  (vertical-scroll-bars . right)
  (bottom-divider-width . 2)
  (right-divider-width . 2)
  (internal-border-width . 0)
  (border-width . 2)
  (font . "-outline-Lucida Console-normal-normal-normal-mono-2-*-*-*-c-*-iso8859-1")
  (font-parameter . "-*-Lucida Console-normal-r-*-*-14-*-*-*-c-*-iso8859-1")
  (font-backend uniscribe gdi))
 (thumfr-thumbnail-frame)
 (name . "*Bookmark List*")
 (zoomed . -1)
 (cursor-color . "Yellow")
 (background-mode . light)
 (display-type . color)
 (fringe . 0)
 (scroll-bar-width . 21)
 (cursor-type . bar)
 (auto-lower)
 (auto-raise)
 (icon-type)
 (fullscreen)
 (title)
 (buffer-predicate)
 (tool-bar-lines . 0)
 (menu-bar-lines . 1)
 (alpha)
 (right-fringe . 0)
 (left-fringe . 0)
 (line-spacing)
 (screen-gamma)
 (border-color . "black")
 (mouse-color . "Yellow")
 (background-color . "LightSteelBlue")
 (foreground-color . "Black")
 (vertical-scroll-bars . right)
 (bottom-divider-width . 2)
 (right-divider-width . 2)
 (internal-border-width . 0)
 (border-width . 2)
 (font . "-outline-Lucida Console-normal-normal-normal-mono-13-*-*-*-c-*-iso8859-1")
 (font-parameter . "-*-Lucida Console-normal-r-*-*-14-*-*-*-c-*-iso8859-1")
 (font-backend uniscribe gdi))

The current version ends up with these frame parameters instead:

((tool-bar-position . top)
 (parent-id)
 (explicit-name)
 (display . "w32")
 (visibility . t)
 (icon-name)
 (window-id . "920808")
 (top . 37)
 (left . 255)
 (buried-buffer-list #<buffer *Backtrace*>)
 (buffer-list #<buffer *Bookmark List*>)
 (unsplittable . t)
 (minibuffer)
 (modeline . t)
 (width . 74) ; <==============================
 (height . 64)
 (name . "*Bookmark List*")
 (zoomed . -1)
 (cursor-color . "Yellow")
 (background-mode . light)
 (display-type . color)
 (fringe . 0)
 (scroll-bar-width . 21)
 (cursor-type . bar)
 (auto-lower)
 (auto-raise)
 (icon-type)
 (fullscreen)
 (title)
 (buffer-predicate)
 (tool-bar-lines . 0)
 (menu-bar-lines . 1)
 (alpha)
 (right-fringe . 0)
 (left-fringe . 0)
 (line-spacing)
 (screen-gamma)
 (border-color . "black")
 (mouse-color . "Yellow")
 (background-color . "LightSteelBlue")
 (foreground-color . "Black")
 (vertical-scroll-bars . right)
 (bottom-divider-width . 2)
 (right-divider-width . 2)
 (internal-border-width . 0)
 (border-width . 2)
 (font . "-outline-Lucida Console-normal-normal-normal-mono-13-*-*-*-c-*-iso8859-1")
 (font-parameter . "-*-Lucida Console-normal-r-*-*-14-*-*-*-c-*-iso8859-1")
 (font-backend uniscribe gdi))

I don't care so much about the height.  What is definitely wrong is
diminishing the specified width (75) by one.  The widest line in the
buffer is 75 chars wide, so fitting the frame to a width of 74 does
not cut the mustard.

Depending on the char (font) size, sometimes the frame fitting still
works as it should.  But for other sizes it has this
one-char-less-than-required-width failing.  E.g., this is the case
also for font "-outline-Lucida
Console-normal-normal-normal-mono-10-*-*-*-c-*-iso8859-1" (same font,
with size 10).

In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-03-21 on ODIEONE
Bzr revision: 116829 [email-masked]
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/snapshot/trunk
 --enable-checking=yes,glyphs 'CFLAGS=-O0 -g3' 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include' LDFLAGS=-Lc:/Devel/emacs/lib'