Subject: Re: bug#21415: 25.0.50; Emacs Trunk -- pixelwise width/height for x-create-frame

From: Keith David Bershatsky <[email-masked]>
Date: Mon, 14 Sep 2015 08:25:25 -0700

The `top` frame parameter is respected when setting the `height` frame parameter in the Emacs built on August 11, 2014, but is broken in the Emacs built on August 12, 2014.  I was not able to revert due to error messages about merging and so forth, but my best guess is that either of the following two commits are responsible:

commit bd4de70f13a92230da479e6fcd87d4355d626edf
Author: Martin Rudalics <[email-masked]>
Date:   Tue Aug 12 11:47:27 2014 +0200

    In set_menu_bar_lines call change_frame_size instead of set_menu_bar_lines_1.
    
    * frame.c (set_menu_bar_lines_1): Remove.
    (set_menu_bar_lines): Call change_frame_size instead of
    set_menu_bar_lines_1.

commit fe2f33e8da2e2c7950214eafdfd610f164025baf
Author: Jan Djärv <[email-masked]>
Date:   Mon Aug 11 15:16:31 2014 +0200

    Fix default width not being 80, but 77.
    
    * nsfns.m (Fx_create_frame): Call adjust_frame_size,
    set f->official.

The crashing of Emacs yesterday (i.e., the application quitting without any error messages) was an anomaly, perhaps caused by running multiple instances and copying running Emacs programs to other directories.  I have not been able to repeat the crashing.  I have been reliably using Emacs built from the last commit on September 11, 2015 using the latest patch, with my own modification striking/removing the portion relating to "if (ns_menu_bar_should_be_hidden ()) return frameRect;" in nsterm.m.  That build seems to be working well for every situation except setting the `top` frame parameter when calling `make-frame, for which I have implemented the hack previously mentioned:

(defadvice face-set-after-frame-default (before face-set-after-frame-default-before activate)
  (let* (
      (top (or (cdr (assq 'top parameters)) 0))
      (left (or (cdr (assq 'left parameters)) 0)) )
    (set-frame-position frame left top)))