unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jeffrey Spencer <jeffspencerd@gmail.com>
To: Peter <peter.milliken@gmail.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>,
	gnu.emacs.help@googlegroups.com
Subject: Re: resize emacs frame / gui-window via keybinding
Date: Wed, 22 Aug 2012 15:02:32 +1000	[thread overview]
Message-ID: <CALmFPZ0Rmc5JysDLcCWVkB=54NkszPYzXWV9Aay+TyfxTh+62w@mail.gmail.com> (raw)
In-Reply-To: <ac16f77d-b03e-44e8-aa16-6d07e8a86567@googlegroups.com>

[-- 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 --]

  reply	other threads:[~2012-08-22  5:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2012-08-21 18:22 Ferdinand
2012-08-21 19:39 ` Mark Skilbeck
2012-08-21 20:06   ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALmFPZ0Rmc5JysDLcCWVkB=54NkszPYzXWV9Aay+TyfxTh+62w@mail.gmail.com' \
    --to=jeffspencerd@gmail.com \
    --cc=gnu.emacs.help@googlegroups.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=peter.milliken@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).