From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: get current frame size?
Date: Mon, 12 Oct 2015 15:04:34 +0200 [thread overview]
Message-ID: <87y4f8w84d.fsf@web.de> (raw)
In-Reply-To: 87612c8fun.fsf@gmail.com
Sivaram Neelakantan <nsivaram.net@gmail.com> writes:
> I end up working with different monitors and each time I end up doing
> a trail and error method to get the right frame size for Emacs that
> covers the width of the screen and 80% of the height. Note that I
> don't want a fullscreen mode which I can invoke from the command
> line. Is there a way to query the current frame to return the
> dimensions so that I can plug it in my .Emacs?
>
> Something like
>
> (if (window-system) (set-frame-size (selected-frame) 124 40))
>
> where the last 2 numbers seem to change for laptop screen
See (info "(elisp) Size Parameters"). But maybe consider doing it
dynamically:
- Note that the fullscreen frame parameter can also be used to maximize
a frame horizontally or vertically.
- You can also calculate the frame parameters at run time using
`display-pixel-width', `display-pixel-width'. But I don't think Emacs
knows the sizes of window borders and title bar, so the approach is
somewhat limited. At least can you use the above functions to test on
which kind of screen you "are".
- Drew Adam's "frame-cmds.el" has additional related stuff.
Michael.
next prev parent reply other threads:[~2015-10-12 13:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-12 11:51 get current frame size? Sivaram Neelakantan
2015-10-12 13:04 ` Michael Heerdegen [this message]
2015-10-12 13:24 ` 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=87y4f8w84d.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=help-gnu-emacs@gnu.org \
/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).