aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/frame.el30
3 files changed, 41 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 77e7e47b8a3..4199bd302a9 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -35,6 +35,9 @@ simply disabling Transient Mark mode does the same thing.
35 35
36* Editing Changes in Emacs 24.4 36* Editing Changes in Emacs 24.4
37 37
38** New commands `toggle-frame-maximized' and `cycle-frame-maximized',
39bound to <f11> and S-<f11>, respectively.
40
38 41
39* Changes in Specialized Modes and Packages in Emacs 24.4 42* Changes in Specialized Modes and Packages in Emacs 24.4
40 43
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a5fab65b34f..adf8d9f88f0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12012-12-12 Sam Steingold <sds@gnu.org>
2
3 * frame.el (frame-maximization-style): New user option.
4 (toggle-frame-maximized): Toggle frame maximization according to
5 `frame-maximization-style', bound to <f11>.
6 (cycle-frame-maximized): Cycle between all maximization styles and
7 non-maximized frame, bound to shift-<f11>.
8
12012-12-12 David Cadé <codename68@gmail.com> 92012-12-12 David Cadé <codename68@gmail.com>
2 10
3 * mpc.el (mpc-format): Use truncate-string-to-width (bug#13143). 11 * mpc.el (mpc-format): Use truncate-string-to-width (bug#13143).
diff --git a/lisp/frame.el b/lisp/frame.el
index 7a54efc23e7..559aa35242d 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1654,12 +1654,42 @@ terminals, cursor blinking is controlled by the terminal."
1654 'blink-cursor-start)))) 1654 'blink-cursor-start))))
1655 1655
1656 1656
1657;; Frame maximization
1658(defcustom frame-maximization-style 'maximized
1659 "The maximization style of \\[toggle-frame-maximized]."
1660 :version "24.4"
1661 :type '(choice
1662 (const :tab "Respect window manager screen decorations." maximized)
1663 (const :tab "Ignore window manager screen decorations." fullscreen))
1664 :group 'frames)
1665
1666(defun toggle-frame-maximized ()
1667 "Maximize/un-maximize Emacs frame according to `frame-maximization-style'.
1668See also `cycle-frame-maximized'."
1669 (interactive)
1670 (modify-frame-parameters
1671 nil `((fullscreen . ,(if (frame-parameter nil 'fullscreen)
1672 nil frame-maximization-style)))))
1673
1674(defun cycle-frame-maximized ()
1675 "Cycle Emacs frame between normal, maximized, and fullscreen.
1676See also `toggle-frame-maximized'."
1677 (interactive)
1678 (modify-frame-parameters
1679 nil `((fullscreen . ,(cl-case (frame-parameter nil 'fullscreen)
1680 ((nil) 'maximized)
1681 ((maximized) 'fullscreen)
1682 ((fullscreen) nil))))))
1683
1684
1657;;;; Key bindings 1685;;;; Key bindings
1658 1686
1659(define-key ctl-x-5-map "2" 'make-frame-command) 1687(define-key ctl-x-5-map "2" 'make-frame-command)
1660(define-key ctl-x-5-map "1" 'delete-other-frames) 1688(define-key ctl-x-5-map "1" 'delete-other-frames)
1661(define-key ctl-x-5-map "0" 'delete-frame) 1689(define-key ctl-x-5-map "0" 'delete-frame)
1662(define-key ctl-x-5-map "o" 'other-frame) 1690(define-key ctl-x-5-map "o" 'other-frame)
1691(define-key global-map [f11] 'toggle-frame-maximized)
1692(define-key global-map [(shift f11)] 'cycle-frame-maximized)
1663 1693
1664 1694
1665;; Misc. 1695;; Misc.