Subject: bug#21413: Top of buffer hidden when toolbar hidden and frame height is large

From: Devon Buchanan <[email-masked]>
Date: Sat, 05 Sep 2015 13:02:02 +0100

On Sat, Sep 05 2015, martin rudalics wrote:
> I doubt it will help much but in such a mangled frame please put 
> the following snippet in *scratch* with point after it, type C-x 
> C-e, and post whatever it inserts here.
>
> (progn 
>    (insert (format "%s" (frame-geometry))) (insert (format "%s" 
>    (frame-edges nil 'outer))) (insert (format "%s" (frame-edges 
>    nil 'native))) (insert (format "%s" (frame-edges nil 
>    'inner))))

I was not able to find the functions frame-geometry and 
frame-edges in emacs 24.5.1. M-x appropos found some functions 
which appear similar however. Here is the results of evaluating 
them in a mangled frame.

cat >> test-init.el <<EOF (tool-bar-mode -1) (setq 
default-frame-alist '((height . 100))) EOF open -a Emacs.app 
--args -Q -l ~/test-init.el

(progn 
  (insert (format "%s" (current-frame-configuration))) (insert 
  (format "%s" (window-edges))) (insert (format "%s" 
  (window-pixel-edges))) (insert (format "%s" 
  (window-absolute-pixel-edges))) (insert (format "%s" 
  (window-inside-edges))) (insert (format "%s" 
  (window-inside-pixel-edges))) (insert (format "%s" 
  (window-inside-absolute-pixel-edges))))

(frame-configuration (#<frame *scratch* 0x104833a48> 
                     ((tool-bar-position . top) 
                      (parent-id) (explicit-name) (display . 
                      Hester.home) (visibility . t) (icon-name) 
                      (window-id . 1) (bottom-divider-width . 0) 
                      (right-divider-width . 0) (top . 23) (left . 
                      5) (buried-buffer-list) (buffer-list 
                      *scratch*) (unsplittable) (minibuffer . 
                      #<window 4 on  *Minibuf-0*>) (modeline . t) 
                      (width . 80) (height . 100) (name . 
                      *scratch*) (environment) (cursor-color . 
                      black) (background-mode . light) 
                      (display-type . color) 
                      (horizontal-scroll-bars . t) (window-system 
                      . ns) (fullscreen) (alpha) (scroll-bar-width 
                      . 15) (cursor-type . box) (auto-lower) 
                      (auto-raise) (icon-type) (title) 
                      (buffer-predicate) (tool-bar-lines . 0) 
                      (menu-bar-lines . 1) (right-fringe . 11) 
                      (left-fringe . 10) (line-spacing) 
                      (background-color . White) (foreground-color 
                      . Black) (vertical-scroll-bars . right) 
                      (internal-border-width . 2) (border-width . 
                      0) (font . 
                      -*-Menlo-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1) 
                     (fontsize . 0) (font-backend mac-ct ns)) 
                    #<window-configuration>)) 
(0 0 85 99)(2 2 598 1388)(7 47 603 1433)(2 0 80 98)(12 2 572 
1374)(17 47 577 1419)

After resizing the window by dragging on its right border with my 
mouse the frame became un-mangled. Here is the output for that 
frame.

(progn 
  (insert (format "%s" (current-frame-configuration))) (insert 
  (format "%s" (window-edges))) (insert (format "%s" 
  (window-pixel-edges))) (insert (format "%s" 
  (window-absolute-pixel-edges))) (insert (format "%s" 
  (window-inside-edges))) (insert (format "%s" 
  (window-inside-pixel-edges))) (insert (format "%s" 
  (window-inside-absolute-pixel-edges))))

(frame-configuration (#<frame *scratch* 0x104820448> 
                      ((tool-bar-position . top) 
                       (parent-id) (explicit-name) (display . 
                       Hester.home) (visibility . t) (icon-name) 
                       (window-id . 1) (bottom-divider-width . 0) 
                       (right-divider-width . 0) (top . 28) (left 
                       . 0) (buried-buffer-list) (buffer-list 
                       *scratch*) (unsplittable) (minibuffer . 
                       #<window 4 on  *Minibuf-0*>) (modeline . t) 
                       (width . 80) (height . 53) (name . 
                       *scratch*) (environment) (cursor-color . 
                       black) (background-mode . light) 
                       (display-type . color) 
                       (horizontal-scroll-bars . t) (window-system 
                       . ns) (fullscreen) (alpha) 
                       (scroll-bar-width . 15) (cursor-type . box) 
                       (auto-lower) (auto-raise) (icon-type) 
                       (title) (buffer-predicate) (tool-bar-lines 
                       . 0) (menu-bar-lines . 1) (right-fringe . 
                       11) (left-fringe . 10) (line-spacing) 
                       (background-color . White) 
                       (foreground-color . Black) 
                       (vertical-scroll-bars . right) 
                       (internal-border-width . 2) (border-width . 
                       0) (font . 
                       -*-Menlo-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1) 
                       (fontsize . 0) (font-backend mac-ct ns)) 
                      #<window-configuration>)) 
(0 0 85 52)(2 2 598 730)(2 52 598 780)(2 0 80 51)(12 2 572 716)(12 
52 572 766)

> Also: Can you reproduce the problem with an already existing or 
> another, newly created one or is only the initial frame 
> affected?

When I create new frames with command-n it is not affected. Only 
the initial frame is affected under the conditions I described. 
The result of running the above in a frame created with command-n 
is:

(progn 
  (insert (format "%s" (current-frame-configuration))) (insert 
  (format "%s" (window-edges))) (insert (format "%s" 
  (window-pixel-edges))) (insert (format "%s" 
  (window-absolute-pixel-edges))) (insert (format "%s" 
  (window-inside-edges))) (insert (format "%s" 
  (window-inside-pixel-edges))) (insert (format "%s" 
  (window-inside-absolute-pixel-edges))))
(frame-configuration (#<frame *scratch* 0x103255e50>
                      ((tool-bar-position . top)
                       (parent-id)
                       (explicit-name)
                       (display . Hester.home)
                       (visibility . t)
                       (icon-name)
                       (window-id . 2)
                       (bottom-divider-width . 0)
                       (right-divider-width . 0)
                       (top . 42)
                       (left . 0)
                       (buried-buffer-list)
                       (buffer-list *scratch*)
                       (unsplittable)
                       (minibuffer . #<window 6 on  *Minibuf-0*>)
                       (modeline . t)
                       (width . 80)
                       (height . 51)
                       (name . *scratch*)
                       (cursor-color . black)
                       (background-mode . light)
                       (display-type . color)
                       (fullscreen)
                       (alpha)
                       (scroll-bar-width . 15)
                       (cursor-type . box)
                       (auto-lower)
                       (auto-raise)
                       (icon-type)
                       (title)
                       (buffer-predicate)
                       (tool-bar-lines . 0)
                       (menu-bar-lines . 1)
                       (right-fringe . 11)
                       (left-fringe . 10)
                       (line-spacing)
                       (background-color . White)
                       (foreground-color . Black)
                       (vertical-scroll-bars . right)
                       (internal-border-width . 2)
                       (border-width . 0)
                       (font . 
                       -*-Menlo-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1)
                       (fontsize . 0)
                       (font-backend mac-ct ns))
                      #<window-configuration>)
                     (#<frame *scratch* 0x100815848>
                      ((tool-bar-position . top)
                       (parent-id)
                       (explicit-name)
                       (display . Hester.home)
                       (visibility . t)
                       (icon-name)
                       (window-id . 1)
                       (bottom-divider-width . 0)
                       (right-divider-width . 0)
                       (top . 28)
                       (left . 0)
                       (buried-buffer-list)
                       (buffer-list *scratch*)
                       (unsplittable)
                       (minibuffer . #<window 4 on  *Minibuf-0*>)
                       (modeline . t)
                       (width . 80)
                       (height . 100)
                       (name . *scratch*)
                       (environment)
                       (cursor-color . black)
                       (background-mode . light)
                       (display-type . color)
                       (horizontal-scroll-bars . t)
                       (window-system . ns)
                       (fullscreen)
                       (alpha)
                       (scroll-bar-width . 15)
                       (cursor-type . box)
                       (auto-lower)
                       (auto-raise)
                       (icon-type)
                       (title)
                       (buffer-predicate)
                       (tool-bar-lines . 0)
                       (menu-bar-lines . 1)
                       (right-fringe . 11)
                       (left-fringe . 10)
                       (line-spacing)
                       (background-color . White)
                       (foreground-color . Black)
                       (vertical-scroll-bars . right)
                       (internal-border-width . 2)
                       (border-width . 0)
                       (font . 
                       -*-Menlo-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1)
                       (fontsize . 0)
                       (font-backend mac-ct ns))
                      #<window-configuration>))
(0 0 85 50)(2 2 598 702)(2 66 598 766)(2 0 80 49)(12 2 572 688)(12 
66 572 752)

Devon