0

For the value of frame-inherited-parameters, I normally use (top left width height) so that new frames have the same geometry as (selected-frame).

Since switching to Emacs 25.1.1, this no longer works completely. Only some of the parameter values are copied to the new frame.

I run on MacOS Sierra. (Therefore my frame-creation-function is the one in term/ns-win.el.)

If I start with a frame like this:

(#<frame  *Minibuf-1* 0x101899c30> (top (+ -568)) (left 1920) (width 177) (height 98))

and press C-x 5 2 (make-frame-command), I end up with frames like this:

(#<frame  *Minibuf-1* 0x108366c38> (top 23) (left 0) (width 80) (height 95))
(#<frame *scratch* 0x101899c30> (top (+ -568)) (left 1920) (width 177) (height 98))

I tried switching the order of frame-inherited-parameters to (width height top left) and ended up with this:

(#<frame  *Minibuf-1* 0x108374618> (width 80) (height 98) (top (+ -568)) (left 1920))
(#<frame *scratch* 0x101899c30> (width 177) (height 98) (top (+ -568)) (left 1920))

All of this happens even though I started emacs with --no-init-file and loaded no libraries since starting it.

  • 1
    Since you have already verified that this happens with emacs -q, then go ahead and submit a bug report. MacOS Sierra is just too new. It may or may not be OS related. None of the emacs.stackexchange.com forum participants are going to suggest modifications of the C-source code, which is what might be needed to create a fix. – lawlist Oct 8 '16 at 18:43
  • @lawlist I submitted a bug report with emacs -Q. I'm not sure if I should close this question or wait for a response and post it as an answer. Any guidance will be welcomed. – Colin Fraizer Oct 8 '16 at 19:31
  • In the past, I have updated my own questions with the link to the bug report and then posted an answer several weeks or months later when the bug is resolved. A few are years old and still have no resolution. – lawlist Oct 8 '16 at 19:32
  • Out of curiosity, what do you actually use frame-inherited-parameters for? (I leave it nil.) Are you binding it during some execution? Or are you counting on it for default behavior (e.g., instead of customizing default-frame-alist). – Drew Oct 8 '16 at 22:57
  • @drew I use it to make new frames I create with C-x 5 2 have the same size and position as the frame that was selected when I invoked the command. – Colin Fraizer Oct 8 '16 at 23:20
0

This has been accepted as a bug in Emacs, but I don't have a lot of hope that someone is eager to fix it. (I looked at it, but didn't have enough background to figure out what was happening.) https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24651

If you, like me, actually used this feature, you can get a similar result by advising (make-frame). I did it like this:

(defun my-make-frame-advice (fcn &rest args)  
  (let* ((frm (selected-frame))  
         (geom-parms (mapcar (lambda (parm)  
                               (cons (parm (frame-parameter frm parm)))  
                             '(left top height width)))
         (new-frm (apply fcn args)))  
    (modify-frame-parameters new-frm geom-parms)
    new-frm))  

(advice-add #'make-frame :around #'my-make-frame-advice)
  • Edited so that "around" advice returned the newly-created frame. Otherwise, it would break stuff that called make-frame and used its value. – Colin Fraizer Nov 23 '16 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.