>> If for some reason you cannot build Emacs or work with master, please >> tell me. I'll then try to explain how to get the desired behavior with >> Emacs 25 and your .emacs alone. Meanwhile closing this bug. > > I'd like to know how to do this on Emacs 25. Store the attached file my-fit-window.el somewhere on your machine, byte-compile it with Emacs 25 and load my-fit-window.elc from .emacs. And please tell me if it works. Thanks, martin