Reputation: 1666
I'm running a 64-bit GNU Emacs version 25.0.50.1 on a 64-bit Windows 8.1 OS.
Adding the following to my .emacs
does nothing:
(w32-send-sys-command 61488)
However, something like:
(global-set-key [(f4)] (function (lambda () "Maximize frame" (interactive) (w32-send-sys-command 61488))))
Works flawlessly; i.e. maximizes Emacs whenever F4 is pressed. However, I do not want to have to press F4 in order to do this -- I want it done automatically at startup. Why doesn't the first simple line work (it doesn't work even if it is the only line in my .emacs
)?
Upvotes: 2
Views: 150
Reputation: 11
This worked for me :
(defun maximize-frame ()
"Maximize the current frame"
(interactive)
(w32-send-sys-command 61488))
(defun post-load-stuff ()
(interactive)
(maximize-frame)
)
(add-hook 'window-setup-hook 'post-load-stuff t)
Upvotes: 1
Reputation: 136880
Some time around the version 24 release, Emacs added a native function toggle-frame-maximized
. This function doesn't take any arguments, but since the default state of Emacs it to have a non-maximized frame, on my Linux system simply adding
(toggle-frame-maximized)
to my init makes Emacs start up maximized.
As far as I know, this should also work on Windows.
Upvotes: 3