From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: maximising window?
Date: Sun, 08 Jun 2014 17:02:18 +0200 [thread overview]
Message-ID: <878up74f7p.fsf@web.de> (raw)
In-Reply-To: alpine.DEB.2.10.1406080017550.3283@james
James Freer <jessejazza3.uk@gmail.com> writes:
> One thing I want to enter in the .emacs is the equivalent of
> alt+f10. Maximise 'window' isn't quite the same from what I've read
> this evening... in emacs they're frames. Vary depending on Mac, linux
> or windows - I'm using Linux Xubuntu on a CRT monitor.
If you want to do it for all new frames, `default-frame-alist' is the
right place:
(add-to-list 'default-frame-alist '(fullscreen . maximized))
See (info "(elisp) Frame Parameters") for details.
Interactively: `toggle-frame-maximized', `toggle-frame-fullscreen', as
it had been suggested. For older Emacsen, you can simply write your own
commands using `modify-frame-parameters'. These definitions from
frame.el should work in Emacs 23, too:
--8<---------------cut here---------------start------------->8---
(defun toggle-frame-maximized ()
"Toggle maximization state of the selected frame.
Maximize the selected frame or un-maximize if it is already maximized.
Respect window manager screen decorations.
If the frame is in fullscreen mode, don't change its mode,
just toggle the temporary frame parameter `maximized',
so the frame will go to the right maximization state
after disabling fullscreen mode.
See also `toggle-frame-fullscreen'."
(interactive)
(if (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
(modify-frame-parameters
nil
`((maximized
. ,(unless (eq (frame-parameter nil 'maximized) 'maximized)
'maximized))))
(modify-frame-parameters
nil
`((fullscreen
. ,(unless (eq (frame-parameter nil 'fullscreen) 'maximized)
'maximized))))))
(defun toggle-frame-fullscreen ()
"Toggle fullscreen mode of the selected frame.
Enable fullscreen mode of the selected frame or disable if it is
already fullscreen. Ignore window manager screen decorations.
When turning on fullscreen mode, remember the previous value of the
maximization state in the temporary frame parameter `maximized'.
Restore the maximization state when turning off fullscreen mode.
See also `toggle-frame-maximized'."
(interactive)
(modify-frame-parameters
nil
`((maximized
. ,(unless (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
(frame-parameter nil 'fullscreen)))
(fullscreen
. ,(if (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
(if (eq (frame-parameter nil 'maximized) 'maximized)
'maximized)
'fullscreen)))))
--8<---------------cut here---------------end--------------->8---
Michael.
next prev parent reply other threads:[~2014-06-08 15:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-07 23:27 maximising window? James Freer
2014-06-08 0:20 ` John Mastro
2014-06-08 0:35 ` Chris F.A. Johnson
2014-06-08 5:49 ` Igor Sosa Mayor
2014-06-08 6:29 ` Shelagh Manton
2014-06-08 6:49 ` Igor Sosa Mayor
[not found] ` <mailman.3235.1402209024.1147.help-gnu-emacs@gnu.org>
2014-06-11 0:06 ` Emanuel Berg
2014-06-08 15:02 ` Michael Heerdegen [this message]
2014-06-08 17:00 ` James Freer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878up74f7p.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.