help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: resize emacs frame / gui-window via keybinding


From: Peter
Subject: Re: resize emacs frame / gui-window via keybinding
Date: Tue, 21 Aug 2012 18:15:11 -0700 (PDT)
User-agent: G2/1.0

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



reply via email to

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