[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Maximize/restore frame function
From: |
Drew Adams |
Subject: |
RE: Maximize/restore frame function |
Date: |
Fri, 3 Oct 2014 22:49:44 -0700 (PDT) |
> Hi, I'm looking for a simple (hopefully!) function to maximize a
> frame/restore to it's previous size.
> I've looked through the apropos and the closest I could find was
> iconify-frame and iconify-or-deiconify-frame, neither of which quite
> does what I want.
> What I want is function to toggle a given frame between being
> maximized on it's display and it's original size
> I work in windows (bleh), I get this same functionality by double
> clicking on the top bar of the frame. This maximizes it to the
> monitor It's on.
> Dual monitor setup with virtuawin multiple desktops if that helps.
> Any ideas?
As Oscar indicated, Emacs 24.4 has this.
You can also toggle maximization (but not fullscreen), on all
platforms in all Emacs versions (starting with Emacs 20), using
library `frame-cmds.el', which you can get from Emacs Wiki (or
MELPA), http://www.emacswiki.org/emacs-en/download/frame-cmds.el
There you will find commands `maximize-frame' and `restore-frame',
aka `toggle-max-frame'. From the doc string:
,----
| Toggle maximization of FRAME horizontally, vertically, or both.
| Reverses or (if restored) repeats the effect of the Emacs maximize
| commands. Does not restore from maximization effected outside Emacs.
|
| With no prefix arg, toggle both directions.
| With a non-negative prefix arg, toggle only vertically.
| With a negative prefix arg, toggle horizontally.
|
| When toggling both directions, each is toggled from its last maximize
| or restore state. This means that using this after
| `maximize-frame-horizontally', `maximize-frame-vertically',
| `toggle-max-frame-horizontally', or `toggle-max-frame-vertically' does
| not necessarily just reverse the effect of that command.
`----
If you use a standalone minibuffer frame then "maximizing" another
frame leaves room for the minibuffer frame; it does not occlude it.
All of the commands in the library work with all Emacs versions
(starting with Emacs 20).