[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Sam Steingold
Subject: toggle-frame-maximized
Date: Tue, 11 Dec 2012 15:38:10 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

A de-facto standard keybinding is f11: maximize/full screen the window.
(chrome, gnome-terminal, freeciv - all comply).

Here is an implementation for emacs:

--8<---------------cut here---------------start------------->8---
(defcustom frame-maximization-mode 'maximized
  "The maximization style of \\[toggle-frame-maximized]."
  :version "24.4"
  :type '(choice
          (const :tab "Respect window manager screen decorations." maximized)
          (const :tab "Ignore window manager screen decorations." fullscreen))
  :group 'frames)

(defun toggle-frame-maximized ()
  "Maximize/un-maximize Emacs frame according to `frame-maximization-mode'."
   nil `((fullscreen . ,(if (frame-parameter nil 'fullscreen)
                            nil frame-maximization-mode)))))

(define-key global-map [f11] 'toggle-frame-maximized)
--8<---------------cut here---------------end--------------->8---

I think this should go into frame.el.

Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://honestreporting.com http://jihadwatch.org
http://americancensorship.org http://dhimmi.com http://iris.org.il
A professor is someone who talks in someone else's sleep.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]