diff options
| author | Sam Steingold | 2012-12-12 09:43:45 -0500 |
|---|---|---|
| committer | Sam Steingold | 2012-12-12 09:43:45 -0500 |
| commit | 37f38bca1dbcce25b4f41928a249ecf937d795ff (patch) | |
| tree | c85378baeca37af3d5bec91d4ae11643fb66df5f | |
| parent | fd49a2185ff4f1710bc337168fd15af91064a74e (diff) | |
| download | emacs-37f38bca1dbcce25b4f41928a249ecf937d795ff.tar.gz emacs-37f38bca1dbcce25b4f41928a249ecf937d795ff.zip | |
* lisp/frame.el (frame-maximization-style): New user option.
(toggle-frame-maximized): Toggle frame maximization according to
`frame-maximization-style', bound to <f11>.
(cycle-frame-maximized): Cycle between all maximization styles and
non-maximized frame, bound to shift-<f11>.
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/frame.el | 30 |
3 files changed, 41 insertions, 0 deletions
| @@ -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', | ||
| 39 | bound 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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-12-12 David Cadé <codename68@gmail.com> | 9 | 2012-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'. | ||
| 1668 | See 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. | ||
| 1676 | See 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. |