* maximising window?
@ 2014-06-07 23:27 James Freer
2014-06-08 0:20 ` John Mastro
2014-06-08 15:02 ` Michael Heerdegen
0 siblings, 2 replies; 9+ messages in thread
From: James Freer @ 2014-06-07 23:27 UTC (permalink / raw)
To: help-gnu-emacs
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.
At console --mm option is fine but only for first frame but not for gui. So I
tried the following... didn't seem to work and then commented them out.
These are the one's I tried (copied from the .emacs)..
;; fullscreen similar to alt+f10
;;(run-with-idle-timer 0.1 nil 'toggle-fullscreen)?
;;(defun toggle-full-screen)?
;;(require 'maxframe)
;;(add-hook 'window-setup-hook 'maximize-frame t)
;; auto frame sizing
;;(require 'autofit-frame)
;;(add-hook 'after-make-frame-functions 'fit-frame)
;; To automatically fit frames that show a temporary buffer in their
;; sole window, add this to your initialization file also:
;;(add-hook 'temp-buffer-window-show-hook ; Emacs 24.4+
;; 'fit-frame-if-one-window 'append)
I don't think I am on the right lines somehow... so ?
thanks
james
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: maximising window?
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 15:02 ` Michael Heerdegen
1 sibling, 1 reply; 9+ messages in thread
From: John Mastro @ 2014-06-08 0:20 UTC (permalink / raw)
To: help-gnu-emacs
Hi James,
James Freer <jessejazza3.uk@gmail.com> wrote:
> 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.
[snip]
> I don't think I am on the right lines somehow... so ?
I think you're looking for `toggle-frame-maximized' or
`toggle-frame-fullscreen'. You could put one on Alt-F10 with something
like this:
(global-set-key (kbd "<M-f10>") 'toggle-frame-fullscreen)
Of if you want Emacs to automatically go full screen when you open it,
perhaps something like this:
(add-hook 'after-init-hook 'toggle-frame-fullscreen)
Best,
John
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: maximising window?
2014-06-08 0:20 ` John Mastro
@ 2014-06-08 0:35 ` Chris F.A. Johnson
2014-06-08 5:49 ` Igor Sosa Mayor
0 siblings, 1 reply; 9+ messages in thread
From: Chris F.A. Johnson @ 2014-06-08 0:35 UTC (permalink / raw)
To: John Mastro; +Cc: help-gnu-emacs
On Sat, 7 Jun 2014, John Mastro wrote:
> I think you're looking for `toggle-frame-maximized' or
> `toggle-frame-fullscreen'. You could put one on Alt-F10 with something
> like this:
>
> (global-set-key (kbd "<M-f10>") 'toggle-frame-fullscreen)
Symbol's function definition is void: toggle-frame-maximized
Symbol's function definition is void: toggle-frame-fullscreen
No apropos matches for `toggle-frame'
(emacs 24.3.1)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: maximising window?
2014-06-08 0:35 ` Chris F.A. Johnson
@ 2014-06-08 5:49 ` Igor Sosa Mayor
2014-06-08 6:29 ` Shelagh Manton
[not found] ` <mailman.3235.1402209024.1147.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 9+ messages in thread
From: Igor Sosa Mayor @ 2014-06-08 5:49 UTC (permalink / raw)
To: help-gnu-emacs
"Chris F.A. Johnson" <chris@cfajohnson.com> writes:
> Symbol's function definition is void: toggle-frame-maximized
> Symbol's function definition is void: toggle-frame-fullscreen
> No apropos matches for `toggle-frame'
>
> (emacs 24.3.1)
I think this is new in emacs 24.4
--
:: Igor Sosa Mayor :: joseleopoldo1792@gmail.com ::
:: GnuPG: 0x1C1E2890 :: http://www.gnupg.org/ ::
:: jabberid: rogorido :: ::
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: maximising window?
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>
1 sibling, 1 reply; 9+ messages in thread
From: Shelagh Manton @ 2014-06-08 6:29 UTC (permalink / raw)
To: help-gnu-emacs
On Sun, 08 Jun 2014 07:49:05 +0200, Igor Sosa Mayor wrote:
> "Chris F.A. Johnson" <chris@cfajohnson.com> writes:
>
>> Symbol's function definition is void: toggle-frame-maximized Symbol's
>> function definition is void: toggle-frame-fullscreen No apropos matches
>> for `toggle-frame'
>>
>> (emacs 24.3.1)
>
> I think this is new in emacs 24.4
For those who can't do the "toggle-frame-fullscreen" you could install
wmctrl from your distribution repository and put this (originally from
Offby1 on IRC many moons ago)
(when (executable-find "wmctrl")
(global-set-key (kbd "<f11>") (lambda () (interactive) "Toggle
fullscreen." (let ((dprobe (assq 'display (frame-parameters
(selected-frame)))))
(when dprobe (shell-command (format "DISPLAY=%s
wmctrl -r :ACTIVE: -btoggle,fullscreen" (cdr dprobe))))))))
As you can see the keyboard shortcut is f11 but I'm sure you can change
that easily enough.
Cheers
Shelagh
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: maximising window?
2014-06-08 6:29 ` Shelagh Manton
@ 2014-06-08 6:49 ` Igor Sosa Mayor
0 siblings, 0 replies; 9+ messages in thread
From: Igor Sosa Mayor @ 2014-06-08 6:49 UTC (permalink / raw)
To: help-gnu-emacs
Shelagh Manton <shelagh.manton@gmail.com> writes:
> For those who can't do the "toggle-frame-fullscreen" you could install
> wmctrl from your distribution repository and put this (originally from
> Offby1 on IRC many moons ago)
interesting. I knew wmctrl, but I do not use it from inside emacs.
Thnaks for the code.
--
:: Igor Sosa Mayor :: joseleopoldo1792@gmail.com ::
:: GnuPG: 0x1C1E2890 :: http://www.gnupg.org/ ::
:: jabberid: rogorido :: ::
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: maximising window?
2014-06-07 23:27 maximising window? James Freer
2014-06-08 0:20 ` John Mastro
@ 2014-06-08 15:02 ` Michael Heerdegen
2014-06-08 17:00 ` James Freer
1 sibling, 1 reply; 9+ messages in thread
From: Michael Heerdegen @ 2014-06-08 15:02 UTC (permalink / raw)
To: help-gnu-emacs
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: maximising window?
2014-06-08 15:02 ` Michael Heerdegen
@ 2014-06-08 17:00 ` James Freer
0 siblings, 0 replies; 9+ messages in thread
From: James Freer @ 2014-06-08 17:00 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: help-gnu-emacs
On Sun, 8 Jun 2014, Michael Heerdegen wrote:
> 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.
Thanks for putting me on the right track.
Just tried 'default-frame-alist' and that's fine.
I'll save the email and look into the later stuff another time.
A lot to learn with emacs and I'm taking it one step at a time.
james
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: maximising window?
[not found] ` <mailman.3235.1402209024.1147.help-gnu-emacs@gnu.org>
@ 2014-06-11 0:06 ` Emanuel Berg
0 siblings, 0 replies; 9+ messages in thread
From: Emanuel Berg @ 2014-06-11 0:06 UTC (permalink / raw)
To: help-gnu-emacs
Shelagh Manton <shelagh.manton@gmail.com> writes:
> For those who can't do the "toggle-frame-fullscreen"
> you could install wmctrl
Yes! When I still used X I had a lot of fun with
wmctrl. I still have those functions around, maybe they
can help the OP get an early start:
http://user.it.uu.se/~embe8573/conf/.zsh/wm
--
underground experts united:
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-06-11 0:06 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-06-08 17:00 ` James Freer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).