I have a fairly long startup for Emacs 24.4 on Microsoft Windows 7. I try to move the frame where I want it during startup, but it snaps back after all the startup code is done running. I don't appear to have any Emacs settings in the Registry.

The simplest way to reproduce this is to run emacs -Q --eval '(sleep-for 3)' and move the frame with the mouse during the sleep time. After three seconds it snaps back to its initial location.

I tried to figure out at what point in Emacs startup this movement occurs by starting up normally (no -Q) with the following in init file:

(add-hook 'after-init-hook (lambda () (message-box "after-init")))
(add-hook 'emacs-startup-hook (lambda () (message-box "emacs-startup")))
(add-hook 'window-setup-hook (lambda () (message-box "window-setup")))

If I do this, I get all three message boxes before the frame moves back.

Is there a way to keep the frame where I move it during startup?

  • 1
    Why not just move the frame programmatically as part of your startup inside Emacs? You can customize the default-frame-alist and/or the initial-frame-alist -- both of which can have a frame size and location. – lawlist May 17 '16 at 19:55

Your Answer

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

Browse other questions tagged or ask your own question.