[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: maximising window?

From: Michael Heerdegen
Subject: Re: maximising window?
Date: Sun, 08 Jun 2014 17:02:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.91 (gnu/linux)

James Freer <address@hidden> 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'."
  (if (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
          . ,(unless (eq (frame-parameter nil 'maximized) 'maximized)
        . ,(unless (eq (frame-parameter nil 'fullscreen) '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'."
      . ,(unless (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
           (frame-parameter nil 'fullscreen)))
      . ,(if (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
             (if (eq (frame-parameter nil 'maximized) 'maximized)
--8<---------------cut here---------------end--------------->8---


reply via email to

[Prev in Thread] Current Thread [Next in Thread]