From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jeffrey Spencer Newsgroups: gmane.emacs.help Subject: Re: resize emacs frame / gui-window via keybinding Date: Wed, 22 Aug 2012 15:02:32 +1000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8f3babc168d5be04c7d3a73a X-Trace: ger.gmane.org 1345611781 27680 80.91.229.3 (22 Aug 2012 05:03:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Aug 2012 05:03:01 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" , gnu.emacs.help@googlegroups.com To: Peter Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 22 07:03:01 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T435m-0005HX-6z for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Aug 2012 07:02:58 +0200 Original-Received: from localhost ([::1]:43399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T435k-0004KE-Ll for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Aug 2012 01:02:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T435e-0004Jz-Kn for help-gnu-emacs@gnu.org; Wed, 22 Aug 2012 01:02:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T435d-0000ae-DV for help-gnu-emacs@gnu.org; Wed, 22 Aug 2012 01:02:50 -0400 Original-Received: from mail-wg0-f41.google.com ([74.125.82.41]:49325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T435d-0000aF-3z for help-gnu-emacs@gnu.org; Wed, 22 Aug 2012 01:02:49 -0400 Original-Received: by wgbds1 with SMTP id ds1so4401916wgb.0 for ; Tue, 21 Aug 2012 22:02:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=HP6SEv1l+TV/W39rglG9GZ1wrK9CFj1Z819M8phDKNc=; b=czcGX4eag16/Q+OAy8b7FKXnIETUakmWKnG6G/TiujNOrTpGgFsEEUeeAA37N/atAJ 8/3u7mv/GUk8JOIO7Rq+9Qhgy1CZmiBqEFCKccTu/pkjVvF8g94cgxOxflHlTo86J8U9 2vGDdmMKPQp/Z4N3ujGshkAJF7EPxoCr07sQQ245LGKvGc4FyDArL5i9AO2qLzx57sYP PH7Jpz0jV0jYbBwekXl3b0Rh377p5u4jYWWFwzhO/T/ek9Qao4ZDW+pNuX9LGIoGNzNR dHSPNvtSsXlapMkq+Xcc5yhDjd/Q9v7Vb8JiFyaDc7TRb1H8cKdQhvdEF3/31pj7Y3uh E4CA== Original-Received: by 10.180.106.137 with SMTP id gu9mr2603042wib.20.1345611767534; Tue, 21 Aug 2012 22:02:47 -0700 (PDT) Original-Received: by 10.216.240.66 with HTTP; Tue, 21 Aug 2012 22:02:32 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.41 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86460 Archived-At: --e89a8f3babc168d5be04c7d3a73a Content-Type: text/plain; charset=ISO-8859-1 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 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 > > --e89a8f3babc168d5be04c7d3a73a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Use to use these but could be modified in a function set to a key bind= ing to provide the desired functionality.
;; Set frame height to = roughly full screen
;; (set-frame-height
;; =A0(selecte= d-frame)
;; =A0(/ (display-pixel-height) (frame-char-height)))
;; ;; = Set frame width to roughly half screen
;; (set-frame-width
<= div>;; =A0(selected-frame)
;; =A0(/ (/ (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 (Wind= ows XP - otherwise I have to do it manually on each startup :-( ).

(defun enlarge-frame ()
=A0 "Enlarge the selected frame to fill a sizeable portion of the scre= en,
based on the current screen resolution"
=A0 (interactive)
=A0 ;; Set the frame size
=A0 ;; set the new width, with a little space on the sides
=A0 (setq lframe-width (- (/ (x-display-pixel-width) (frame-char-width)) 8)= )
=A0 ;; set the new height, allowing for title bars
=A0 (setq lframe-height (- (/ (x-display-pixel-height) (frame-char-height))= 5))
=A0 ;; apply to the selected frame
=A0 (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 stateme= nt.

Hope this is a possible solution to why you want to know this information := -)

Peter


--e89a8f3babc168d5be04c7d3a73a--