delqn.com

Set F11 to toggle Emacs full screen mode

(defun toggle-fullscreen (&optional f)
  (interactive)
  (let ((current-value (frame-parameter nil 'fullscreen)))
   (set-frame-parameter nil 'fullscreen
                    (if (equal 'fullboth current-value)
                        (if (boundp 'old-fullscreen) old-fullscreen nil)
                        (progn (setq old-fullscreen current-value)
                               'fullboth)))))
(global-set-key [f11] 'toggle-fullscreen)
; Make new frames fullscreen by default. Note: this hook doesn't do
; anything to the initial frame if it's in your .emacs, since that file is
; read _after_ the initial frame is created.
(add-hook 'after-make-frame-functions 'toggle-fullscreen)

; Start in full screen mode
(run-with-idle-timer 0.1 nil 'toggle-fullscreen)