* resize emacs frame / gui-window via keybinding
@ 2012-08-21 18:22 Ferdinand
2012-08-21 19:39 ` Mark Skilbeck
0 siblings, 1 reply; 5+ messages in thread
From: Ferdinand @ 2012-08-21 18:22 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org
Hi,
Is there a way to resize an emacs-frame via a custom defined shortcut?
(like you can change the initial frame size by changing the variable initial-frame-alist)
thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: resize emacs frame / gui-window via keybinding
2012-08-21 18:22 Ferdinand
@ 2012-08-21 19:39 ` Mark Skilbeck
2012-08-21 20:06 ` Drew Adams
0 siblings, 1 reply; 5+ messages in thread
From: Mark Skilbeck @ 2012-08-21 19:39 UTC (permalink / raw)
To: Ferdinand; +Cc: help-gnu-emacs@gnu.org
You have {enlarge,shrink}-window-{horizontally,vertically}; maybe that's
what you're looking for.
On Tue, Aug 21, 2012 at 08:22:55PM +0200, Ferdinand wrote:
> Hi,
>
> Is there a way to resize an emacs-frame via a custom defined shortcut?
> (like you can change the initial frame size by changing the variable initial-frame-alist)
>
> thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: resize emacs frame / gui-window via keybinding
2012-08-21 19:39 ` Mark Skilbeck
@ 2012-08-21 20:06 ` Drew Adams
0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2012-08-21 20:06 UTC (permalink / raw)
To: 'Mark Skilbeck', 'Ferdinand'; +Cc: help-gnu-emacs
> > Is there a way to resize an emacs-frame via a custom
> > defined shortcut?
>
> You have {enlarge,shrink}-window-{horizontally,vertically};
> maybe that's what you're looking for.
No, those are for Emacs windows, not frames.
But there are commands to do this in `frame-cmds.el' (e.g.
`(enlarge|shrink)-frame(-horizontally)'.
http://www.emacswiki.org/emacs/download/frame-cmds.el
http://emacswiki.org/emacs/FrameModes#FrameCommands
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: resize emacs frame / gui-window via keybinding
[not found] <mailman.7352.1345573403.855.help-gnu-emacs@gnu.org>
@ 2012-08-22 1:15 ` Peter
2012-08-22 5:02 ` Jeffrey Spencer
0 siblings, 1 reply; 5+ messages in thread
From: Peter @ 2012-08-22 1:15 UTC (permalink / raw)
To: gnu.emacs.help; +Cc: help-gnu-emacs@gnu.org
Depends on why (as always, it would help us help you :-)). For instance, I have this in my .emacs - it sizes Emacs to fill the screen on startup (Windows XP - otherwise I have to do it manually on each startup :-( ).
(defun enlarge-frame ()
"Enlarge the selected frame to fill a sizeable portion of the screen,
based on the current screen resolution"
(interactive)
;; Set the frame size
;; set the new width, with a little space on the sides
(setq lframe-width (- (/ (x-display-pixel-width) (frame-char-width)) 8))
;; set the new height, allowing for title bars
(setq lframe-height (- (/ (x-display-pixel-height) (frame-char-height)) 5))
;; apply to the selected frame
(set-frame-size (selected-frame) lframe-width lframe-height))
The final line in the .emacs is this (otherwise if you just run it as part of your .emacs it resizes during loading of the .emacs and then reverts to the default "small" size after it has completed processing your .emacs!):
(run-at-time "0.1 sec" nil 'enlarge-frame)
Depending, you might need to expand the time specified in this last statement.
Hope this is a possible solution to why you want to know this information :-)
Peter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: resize emacs frame / gui-window via keybinding
2012-08-22 1:15 ` resize emacs frame / gui-window via keybinding Peter
@ 2012-08-22 5:02 ` Jeffrey Spencer
0 siblings, 0 replies; 5+ messages in thread
From: Jeffrey Spencer @ 2012-08-22 5:02 UTC (permalink / raw)
To: Peter; +Cc: help-gnu-emacs@gnu.org, gnu.emacs.help
[-- Attachment #1: Type: text/plain, Size: 1711 bytes --]
Use to use these but could be modified in a function set to a key binding
to provide the desired functionality.
;; Set frame height to roughly full screen
;; (set-frame-height
;; (selected-frame)
;; (/ (display-pixel-height) (frame-char-height)))
;; ;; Set frame width to roughly half screen
;; (set-frame-width
;; (selected-frame)
;; (/ (/ (display-pixel-width) 4) (frame-char-width)))
On Wed, Aug 22, 2012 at 11:15 AM, Peter <peter.milliken@gmail.com> wrote:
> Depends on why (as always, it would help us help you :-)). For instance, I
> have this in my .emacs - it sizes Emacs to fill the screen on startup
> (Windows XP - otherwise I have to do it manually on each startup :-( ).
>
> (defun enlarge-frame ()
> "Enlarge the selected frame to fill a sizeable portion of the screen,
> based on the current screen resolution"
> (interactive)
> ;; Set the frame size
> ;; set the new width, with a little space on the sides
> (setq lframe-width (- (/ (x-display-pixel-width) (frame-char-width)) 8))
> ;; set the new height, allowing for title bars
> (setq lframe-height (- (/ (x-display-pixel-height) (frame-char-height))
> 5))
> ;; apply to the selected frame
> (set-frame-size (selected-frame) lframe-width lframe-height))
>
> The final line in the .emacs is this (otherwise if you just run it as part
> of your .emacs it resizes during loading of the .emacs and then reverts to
> the default "small" size after it has completed processing your .emacs!):
>
> (run-at-time "0.1 sec" nil 'enlarge-frame)
>
> Depending, you might need to expand the time specified in this last
> statement.
>
> Hope this is a possible solution to why you want to know this information
> :-)
>
> Peter
>
>
[-- Attachment #2: Type: text/html, Size: 2235 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-08-22 5:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.7352.1345573403.855.help-gnu-emacs@gnu.org>
2012-08-22 1:15 ` resize emacs frame / gui-window via keybinding Peter
2012-08-22 5:02 ` Jeffrey Spencer
2012-08-21 18:22 Ferdinand
2012-08-21 19:39 ` Mark Skilbeck
2012-08-21 20:06 ` Drew Adams
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).