[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r111202: * lisp/frame.el (frame-maxim
From: |
Sam Steingold |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r111202: * lisp/frame.el (frame-maximization-style): New user option. |
Date: |
Wed, 12 Dec 2012 09:43:45 -0500 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 111202
committer: Sam Steingold <address@hidden>
branch nick: trunk
timestamp: Wed 2012-12-12 09:43:45 -0500
message:
* 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>.
modified:
etc/NEWS
lisp/ChangeLog
lisp/frame.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2012-12-10 12:38:49 +0000
+++ b/etc/NEWS 2012-12-12 14:43:45 +0000
@@ -35,6 +35,9 @@
* Editing Changes in Emacs 24.4
+** New commands `toggle-frame-maximized' and `cycle-frame-maximized',
+bound to <f11> and S-<f11>, respectively.
+
* Changes in Specialized Modes and Packages in Emacs 24.4
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-12-12 14:42:03 +0000
+++ b/lisp/ChangeLog 2012-12-12 14:43:45 +0000
@@ -1,3 +1,11 @@
+2012-12-12 Sam Steingold <address@hidden>
+
+ * 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>.
+
2012-12-12 David Cadé <address@hidden>
* mpc.el (mpc-format): Use truncate-string-to-width (bug#13143).
=== modified file 'lisp/frame.el'
--- a/lisp/frame.el 2012-10-20 03:42:02 +0000
+++ b/lisp/frame.el 2012-12-12 14:43:45 +0000
@@ -1654,12 +1654,42 @@
'blink-cursor-start))))
+;; Frame maximization
+(defcustom frame-maximization-style '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-style'.
+See also `cycle-frame-maximized'."
+ (interactive)
+ (modify-frame-parameters
+ nil `((fullscreen . ,(if (frame-parameter nil 'fullscreen)
+ nil frame-maximization-style)))))
+
+(defun cycle-frame-maximized ()
+ "Cycle Emacs frame between normal, maximized, and fullscreen.
+See also `toggle-frame-maximized'."
+ (interactive)
+ (modify-frame-parameters
+ nil `((fullscreen . ,(cl-case (frame-parameter nil 'fullscreen)
+ ((nil) 'maximized)
+ ((maximized) 'fullscreen)
+ ((fullscreen) nil))))))
+
+
;;;; Key bindings
(define-key ctl-x-5-map "2" 'make-frame-command)
(define-key ctl-x-5-map "1" 'delete-other-frames)
(define-key ctl-x-5-map "0" 'delete-frame)
(define-key ctl-x-5-map "o" 'other-frame)
+(define-key global-map [f11] 'toggle-frame-maximized)
+(define-key global-map [(shift f11)] 'cycle-frame-maximized)
;; Misc.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r111202: * lisp/frame.el (frame-maximization-style): New user option.,
Sam Steingold <=